Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combobox
Message
From
03/05/2004 22:31:22
 
General information
Forum:
Visual Basic
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00900395
Message ID:
00900587
Views:
26
Option Explicit
' you can use the combo style property to simulate a list box with the combo
'and modify its size by changing it at design time with the mouse or keyboard

'Dont forget to change the Combo1 style property like "Combo1.Style = vbComboSimple" first ok?

Private Sub Form_Load()
With Combo1
.AddItem "Some text in this first line", 0
.AddItem "Some text in this second line", 1
.AddItem "Some text in this before the last line", 2
.AddItem "Some text in this last line", 3
End With
End Sub

'however with this combo style users can still type on it,and U dont want that, ok there's another way to
'avoid users into type their own text and "force them"*(not literally talking)
' to choose from the values of the combo1, and is by setting the style property of combo1 to
'vbComboDropDownList such as Combo1.Style = vbComboDropDownList which is an option
'to the regular ListBox when you dont have much space on the form to set the info.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform