Changes

A Simple Visual Basic Example

87 bytes added, 18:52, 16 July 2007
Creating an Event
</pre>
This is a Visual basic Subroutine where code is placed to define what happens when a Click event is detected on the button (i.e the user clicks on the button in the user interface of our application). In this example we want the application to close when the closeButton is pressed. To achieve this we add a single line of Visual Basic code to the closeButton_Click() sub-routine as followsso that the code calls the ''Close()'' method to exit the application:
<pre>
Private Sub closeButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles closeButton.Click
Close()
End Sub