Button


The Button control is a simple push button. You can use it to let the user tell the program to do something.

A Button can display a textual caption, a picture, or both. Use the ImageAlign and TextAlign properties to determine where the caption and picture appear in the Button.

When the user clicks the Button, it raises its Click event. The program can take the appropriate action in the Button control’s Click event handler, as shown in the following code:

  Private Sub btnValidatePhoneNumber_Click(ByVal sender As System.Object, _  ByVal e As System.EventArgs) Handles btnValidatePhoneNumber.Click     ValidatePhoneNumber(txtPhoneNumber.Text) End Sub 

You can use the control’s ImageList and ImageIndex properties to assign an image to the Button.

If you set a form’s AcceptButton property to a Button, the Button control’s Click event handler runs when the user presses the Enter key while the form has focus. Similarly if you set a form’s CancelButton property to a Button, the Button control’s Click event handler runs when the user presses the Escape key while the form has focus.




Visual Basic 2005 with  .NET 3.0 Programmer's Reference
Visual Basic 2005 with .NET 3.0 Programmer's Reference
ISBN: 470137053
EAN: N/A
Year: 2007
Pages: 417

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net