VB.NET ComboBox Control
The ComboBox control is used to display more than one item in a drop-down list. It is a combination of Listbox and Textbox in which the user can input only one item. Furthermore, it also allows a user to select an item from a drop-down list.
Let's create a ComboBox control in the VB.NET Windows by using the following steps.
Step 1: We need to drag the combo box control from the toolbox and drop it to the Windows form, as shown below.
Step 2: Once the ComboBox is added to the form, we can set various properties of the ComboBox by clicking on the ComboBox control.
There are following properties of the ComboBox control.
||The AllowSelection property takes the value that indicates whether the list allows selecting the list item.
||It takes a value that represents how automatic completion work for the ComboBox.
||It takes a value that determines whether the control is created or not.
||It is used to bind the data with a ComboBox Control.
||The BackColor property is used to set the background color of the combo box control.
||It is used to get or set the data source for a ComboBox Control.
||It is used to set the style or appearance for the ComboBox Control.
||The MaxDropDownItems property is used in the combo box control to display the maximum number of items by setting a value.
||It is used by the user to enter maximum characters in the editable area of the combo box.
||It is used to set or get the selected item in the ComboBox Control.
||The Sorted property is used to sort all the items in the ComboBox by setting the value.
||It occurs when the property of the font value is changed.
||When the data is bound with a combo box control, a format event is called.
||It occurs when the property value of SelectIndexChanged is changed.
||When the user requests for help in control, the HelpRequested event is called.
||It occurs when the user leaves the focus on the ComboBox Control.
||It occurs when the property of margin is changed in the ComboBox control.
Let's create a program to display the Calendar in the VB.NET Windows Form.
Now select the day, month, and year from dropdown box and then click on the Date button to display the date in the form.