Changes

Jump to: navigation, search

Understanding Visual Basic Events

18 bytes added, 17:34, 17 July 2007
no edit summary
In our example we want every keystroke performed by the user in the TextBox to be displayed by the Label control. In this case the ''TextChanged'' event is exactly the event we want. If, however, we had wanted to write the procedure for a different event on the TextBox we could simply click on the right-hand drop down menu above the code area to view and and select from a list of events available on this type of control:
[[Image:Examplvisual_studio_event_list.jpg]]
With the ''TextChanged'' event still selected it is time to write the Visual Basic code that will be executed when the event is triggered. To do so, we will need to set the ''Text'' property of the ''myLabel'' control to equal the ''Text'' property of the ''textInput'' control. The properties of objects are accessed using what is called dot notation. For example the ''Text'' property of ''myLabel'' is accessed in Visual basic code as follows:

Navigation menu