SpriteHand
Module Border
  Notes for VB.NET Class
Module Border
Location: BlogsAndy's Blog    
Posted by: host 6/14/2006 12:44 PM

Here are a couple of notes for the VB.NET class I instructed at this week...

(1) Creating a global exception handler for WindowsForms (.NET 1.1):  This is a multistep process (note that in .NET 2.0 they give you a global exception handler in Project properties which is nicer). Create a Sub Main module that creates your main form and adds a handler for the Application.ThreadException. In Project Properties, change your startup object to Sub Main. (code below)

 

Module SubMain

    Public Sub main()

        Try
           
AddHandler Application.ThreadException, AddressOf HandleExceptionEvent

            Dim frmMain As New Form1
            Application.Run(frmMain)

        Catch ex As Exception
            HandleException(ex)

        End Try

    End Sub

    Private Sub HandleExceptionEvent(ByVal sender As Object, ByVal e As System.Threading.ThreadExceptionEventArgs)

        HandleException(e.Exception)

    End Sub

    Private Sub HandleException(ByVal ex As Exception)

        MsgBox("Sorry, an error has occurred:" & ex.Message)

    End Sub

End Module

 

(2) Creating a TextBox class that handles Enter as Tab key:  some users prefer hitting ENTER on each WindowsForms field to "tab" to the next field. We can do this by creating an inhertied textbox and handling its KeyPress event. First create a new Class and then implement as follows

Public Class TextBoxEnterTab
    Inherits TextBox

    Private Sub TextBoxEnterTab_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles MyBase.KeyPress

        If e.KeyChar = Chr(13) Then

            SendKeys.Send("{TAB}")
            e.Handled = True

        End If

    End Sub

End Class

(3) Code Generation Tools: Check out MyGeneration dOOdads and CodeSmith

(4) Miscellaneous tools and utilities for development
VBCommenter - generates comment blocks for VB.NET  http://www.gotdotnet.com/team/ide/

NDoc - generates documentation automatically form XML comments  http://ndoc.sourceforge.net

NET Reflector - used to disassemble assemblies  http://www.aisto.com/roeder/dotnet/

REGEXLIB - an online Regular Expression library to use with the Regular Expression Validator controls http://www.regexlib.com

Enterprise Library - Microsoft's Application Blocks for handling common development tasks http://www.microsoft.com/downloads/details.aspx?familyid=5A14E870-406B-4F2A-B723-97BA84AE80B5&displaylang=en
   http://msdn.microsoft.com/library/?url=/library/en-us/dnpag2/html/EntLib2.asp

Atlas   http://atlas.asp.net - Microsoft's AJAX library, including Behaviors

Permalink |  Trackback

Title:
Comment:
Add Comment   Cancel 
Module Border Module Border
Module Border
  Subscribe
Module Border
RSS   Twitter
Module Border Module Border
Module Border
  Diversions
Module Border

TALKING RAGDOLL
This Windows Phone 7 App was created using Silverlight, the  Physics Helper Library,  and the Farseer Physics Engine. It gets interesting when you import your friends photos and have your way with them!

MORE INFO



DROPPYPOP
This Windows Phone 7 game was created using Silverlight, the  Physics Helper Library,  and the Farseer Physics Engine.
DEMO

MORE INFO



BOSS LAUNCH
This physics game won first place in the Server Quest Contest. Created using Silverlight 2, the Physics Helper Library,  and the Farseer Physics Engine.
PLAY IT

MORE INFO



DESTROY ALL INVADERS
A scrolling shooter game where the objective is to destroy the invading UFO's flying over a neighborhood of your choosing. Imagery provided by Microsoft Virtual Earth. Created using Silverlight 2.
PLAY IT

INFO AND CODE



PHYSICS HELPER DEMOS
These demos were created for the Physics Helper Library, which makes it easy to create physics games and simulations using Expression Blend, Silverlight, and the Farseer Physics Engine.
PLAY IT

INFO AND CODE



HOOK SHOT
This little basketball game took first place in the TeamZoneSports Silverlight Contest. Created using Silverlight 2 and the Farseer Physics engine.
PLAY IT

MORE INFO



SORT THE FOOBARS
A game where you need to sort the good foobars from the bad ones. Created using Silverlight 2 and the Farseer Physics engine.
PLAY IT

MORE INFO



POLYGON PHYSICS DEMO
A demo showing polygon physics where the user draws physics objects with the mouse. Created using Silverlight 2 and the Farseer Physics engine.
PLAY IT

MORE INFO



SILVERLIGHT ROCKS!
Destroy the asteroids before they destroy your ship! Created using Silverlight 2.
PLAY IT

INFO AND CODE



FISH GAME
A simple game of harpoon-the-fish. Written using the AJAX Sprite Toolkit.
PLAY IT

INFO AND CODE

Module Border Module Border
Module Border
  Search_Blog
Module Border
Module Border Module Border
Module Border
  Blog_Archive
Module Border
Module Border Module Border
Copyright (c) 2013 andy.beaulieu.com - Login