Sunday, January 10, 2010

OptionButton control

What is OptionButton?


CheckBox control can select multiple controls. In contrast an OptionButton control is used for mutually exclusive selection. That means only one optionbutton can be selected at a time. For example the Gender / sex of a person is given using OptionButton. Only Male or Female can be selected. To offer several fields use them on a frame control.

The Value property of the optionbutton can be set to true or false. True means slected false means not selected. Style property can be used to set picture to the option button. Visible property can be set to true or false.

Appearance property Returns/sets whether or not the optionbutton is painted at run time with 3-D effects.

Caption property is used to set the Descriptive text on the control.

You can use Control Array option to give same name to multiple controls. In this case give the same name and VB will ask You already have a control name '---'. Do you want to create a control array? Give yes to create the control array. You can access the control by giving array index numbers.