Changes

Jump to: navigation, search

Understanding Visual Basic Events

27 bytes added, 17:36, 17 July 2007
Wiring Up Events in Visual Studio
Visual Studio, of course, makes life easy for us when accessing peroperties of objects. At the point that you type the '.' after ''myLabel'' a drop down list of properties available with this type of object is displayed from which to choose. Either select the ''Text'' property from the list, or continue to type the word ''Text''. Repeat this for the ''textInput'' property:
[[Image:Examplevisual_studio_event_completion.jpg]]
The implementation of the TextChanged event handler for our ''inputText'' control is now complete. Now we need to implement the event procedure for the Button. The drop down menu to the left of the event type menu contains a list of all the objects in our application and may be used to switch to editing the event procedures for an object other than the currently selected TextBox control. Use this menu to select the ''myButton'' control. Once again Visual Studio selects the most likely event, in this case 'Click'' which, in this case is the event we wish to handle. Modify the event procedure to call ''Close()'' as follows:

Navigation menu