Changes

ComboBox Control in VB6

871 bytes added, 03:53, 29 January 2008
/* ListIndex */
The following lines were added (+) and removed (-):
  ist1.clear 'Clear the list box  list1.clear 'Clear the list boxThe currently selected item's index can be returned with the listindex property. A listindex property of -1 indicates that no item has been selectedThe currently selected item's index can be returned with the listindex property. A listindex property of -1 indicates that no item has been selected. This can be used to set the selected item as well such as in the following example taken from [[Strange_Errors_in_VB6#Automation_error.2C_The_object_invoked_has_disconnected_from_its_clients.]] cboSkGroup.AddItem ("<All Skill Groups Available>") cboSkGroup.ListIndex = 0 === Style === You can make the combobox allow the user to enter something not in the drop down list, or be restricted to selecting only what is in the drop down list with the style property. * 0 fmStyleDropDownCombo - allow user to enter item not in list or select from list* 2 fmStyleDropDownList - user only allowed to select from list'''Simulate the way a ComboBox works on a Web Form!'''Next Example: '''Simulate the way a ComboBox works on a Web Form!''' (very useful)You want to select an employee name from the combo box, yet capture the hidden employee code which is the key field for doing a database query.  This is common on web forms.  You can do it in a Visual BASIC application also.
Bureaucrat, administrator
16,192
edits