VB.NET CheckBox Control
The CheckBox control is a control that allows the user to select or deselect options from the available options. When a checkbox is selected, a tick or checkmark will appear on the Windows form.
Let's create a CheckBox control in the VB.NET Windows form using the following steps.
Step 1: We need to drag the CheckBox control from the toolbox and drop it to the Windows form, as shown below.
Step 2: Once the CheckBox is added to the form, we can set various properties of the checkbox by clicking on the CheckBox control.
There are some properties of the VB.NET CheckBox control.
||It is used to get the default size of the checkbox.
||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 CheckBox control.
||It is used to set the checkmark's alignment, such as horizontal or vertical on the checkbox.
||The Appearance property is used to display the appearance of a checkbox control by setting a value.
||The CheckState property is used to verify whether the checkbox status is checked in the window form.
||The ThreeState property is used to check whether the control allows one to set three check positions instead of two by setting values.
||It is used to obtain or set the flat appearance of a checkbox.
There are some Methods of the VB.NET CheckBox control.
||The OnClick method is used to fetch the Click event in the CheckBox control.
||It is used to call the CheckStateChanged event in the CheckBox control.
||The ToString method is used to return the current string of the CheckBox control.
||When the Checked property is changed in the CheckBox control, the OnCheckedChanged events occur.
||It is used when it receives the OnMouseUp event in the CheckBox control.
There are some Events of the VB.NET CheckBox control.
||The CheckedChanged event is found when the value of the checked property is changed to CheckBox.
||It occurs when the user performs a double click on the CheckBox control.
||It occurs when the value of the CheckState property changes to the CheckBox control.
||It occurs when the property of the Appearance is changed to the CheckBox control.
Let's create a program to understand the uses of CheckBox control in the VB.NET form.
Now select the fruit name by clicking on the items.
Now click on the Submit button, it displays the following output on your screen.