PDA

View Full Version : Solved: Combobox popup window without scroll bars



theopract
04-16-2008, 05:05 AM
Is it possible to get rid of scroll bars in combobox? In other world I want to have a full view of all items then choosing them from combobox.

The problem is that items in combobox are quite long, so they are cutted even with scroll bars.

theopract
04-17-2008, 09:55 AM
It's fine now. It was just about playing with properties of combobox and reducing number of lines to be written to the combobox's items.

Part of code:
UserForm1.Controls("ComboBox" & d).ColumnCount = 2
UserForm1.Controls("ComboBox" & d).ColumnWidths = 20
UserForm1.Controls("ComboBox" & d).ListWidth = 400
UserForm1.Controls("ComboBox" & d).ListRows = list
UserForm1.Controls("ComboBox" & d).Clear
For i = 0 To (list - 1)
If LTrim(Mylist(i, 0)) <> "" Then
UserForm1.Controls("ComboBox" & d).AddItem
UserForm1.Controls("ComboBox" & d).Column(0, i) = Mylist(i, 0)
UserForm1.Controls("ComboBox" & d).Column(1, i) = Mylist(i, 1)
Else: Exit For
End If
Next i
But I still can't understand how to set all columns width independent since error appeard on such a code:
UserForm1.Controls("ComboBox" & d).ColumnWidths = 20; 40

tstav
04-17-2008, 10:15 AM
The value assigned to .ColumnWidths must be a string
UserForm1.Controls("ComboBox" & d).ColumnWidths = "20;40"

theopract
04-21-2008, 09:58 AM
The value assigned to .ColumnWidths must be a string
UserForm1.Controls("ComboBox" & d).ColumnWidths = "20;40" Oh, I'm stupid, that's quite evident! Thank you =)