|
Programming > Visual Basic > Tutorial > 7 - Ending a Program
|
Now add another command button to your form as shown below:
Once you have done this, double click on the new button and type "end" in the appropriate place as the coding below shows. The "end" that you type automatically changes colour as it is a recognised command in Visual Basic.
Private Sub Command2_Click()
End
End Sub
If you now run the form and click on the second command button, the form will close and stop running. In short, you have created an Exit button.
Now take a look at: Customising VB Buttons
Search for "Visual Basic" on:
Google |
Kelkoo |
Amazon |
eBay (UK) |
eBay (US)
Search for "Visual Basic" on the rest of Computing Students: Visual Basic
Find Visual Basic (VB) Programming Books in the Computing Students Computer Science Book Shop
|
|
|