Javatpoint Logo
Javatpoint Logo

RadioButton Control

The RadioButton is used to select one option from the number of choices. If we want to select only one item from a related or group of items in the windows forms, we can use the radio button. The RadioButton is mutually exclusive that represents only one item is active and the remains unchecked in the form.

Let's create a RadioButton control in the VB.NET Windows by using the following steps.

Step 1: Drag the RadioButton control from the toolbox and drop it to the Windows form, as shown below.

RadioButton Control

Step 2: Once the RadioButton is added to the form, we can set various properties of the RadioButton by clicking on the Radio control.

RadioButton Properties

There are following properties of the VB.NET RadioButton control.

Property Description
AllowDrop It is used to set or get a value representing whether the RadioButton allows the user to drag on the form.
Appearance It is used to get or set a value that represents the appearance of the RadioButton.
AutoScrollOffset It is used to get or set the radio control in ScrollControlIntoView(Control).
AutoCheck The AutoCheck property is used to check whether the checked value or appearance of control can be automatically changed when the user clicked on the RadioButton control.
AutoSize The AutoSize property is used to check whether the radio control can be automatically resized by setting a value in the RadioButton control.
CanSelect A CanSelect property is used to validate whether a radio control can be selected by setting a value in the RadioButton control.
CheckAlign It is used to obtain or set a value that indicates the location of the check portion in the radioButton control.
Text The Text property is used to set the name of the RadioButton control.

RadioButton Methods

Method Name Description
Contains(Control) The Contains() method is used to check if the defined control is available in the RadioButton control.
DefWndProc(Message) It is used to send the specified message to the Window procedure.
DestroHandle() It is used to destroy the handle associated with the RadioButton Control.
Focus() The Focus() method is used to set the input focus to the window form's RadioButton control.
GetAutoSizeMode() It is used to return a value that represents how the control will operate when the AutoSize property is enabled in the RadioButton control of the Window form.
ResetText() As the name suggests, a ResetText() method is used to reset the property of text to its default value or empty.
Update() It is used to reroute an invalid field, which causes control in the client region.

We can also refer to Microsoft documentation to get a complete list of RadioButton Control properties and methods in the VB .NET.

Let's create a program to understand the uses of Radio button control in the VB.NET form.



RadioButton Control

Click on the Submit button. It shows the following message on the screen.

RadioButton Control
Next TopicCheckBox Control

Youtube For Videos Join Our Youtube Channel: Join Now


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA