Button Control in VB.NET


Button is a widely used control in window application.
It is used to perform an action.
Whenever user clicks on a Button the click event associated with the Button is fired and the action associated with the event is executed.

Properties of Button Control



Property Purpose

BackColor

It is used to get or set background color of the Button.

Font

It is used to set Font Face, Font Style, Font Size and Effects of the text associated with Button Control.

ForeColor

It is used to get or set Fore color of the text associated with Button Control.

     

Enabled

It is used to specify weather Button Control is enabled or not at run time. It has Boolean value. Default value is true.

FlatStyle

It is used to get or set appearance of the Button Control when user moves mouse on it or click on it. It has following 4 options:
System, Popup, Standard, Flat

Image

It is used to specify an image that is displayed in Button Control.

ImageAlign

It is used to get or set alignment of the image that is displayed in the Button control.

Text

It is used to get or set text associated with the Button Control.

TextAlign

It is used to get or set alignment of the text associated with the Button control.

Visible

It is used to specify weather Button Control is visible or not at run time. It has Boolean value. Default value is true.

TextImageRelation

It is used to get or set position of text in relation with image. It has following 5 options:
(1) Overlay
(2) ImageAboveText
(3) TextAboveImage
(4) ImageBeforeText
(5) TextBeforeImage
It is used when user wants to display both text and image on Button Control.

TabStop

It is used to specify weather user can use TAB key to set focus on Button Control or not. It has Boolean value. Default value is true.


Methods of Button Control in VB.NET



Method Purpose

Show

It is used to show Button control at run time.

Hide

It is used to hide Button control at run time.

Focus

It is used to set input focus on Button Control at run time.


Event of Button Control in VB.NET



Event Purpose

Click

It is the default event of Button Control. It fires each time user clicks on Button Control.


Download Projects


Download Programs