dwilliams
01-30-2004, 07:21 AM
I have a combobox that I can add items to, but the items *never* are displayed at runtime ... In the below code, I have tried getting logical drive letters into the combobox directly - nothing displays in combobox although debug shows 5 items (which is correct - I have 5 logical drives). I have tried getting the list of logical drives into a string and adding the string with AddRange but still no items show in the combobox. I can look at the contents of the string (str) and I see the 5 logical drives as 5 text items but still nothing will show in the combobox ... seems the only way to get anything to show in the combobox is to hard code them through the properties window for combobox items collection (not desired).
Any clue why the combobox will never show anything??
Private Sub MainForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim Combobox1 As New ComboBox
Dim str() As String
str = IO.Directory.GetLogicalDrives
Combobox1.Items.AddRange(str)
'Combobox1.Items.AddRange(IO.Directory.GetLogicalDrives)
End Sub
Any clue why the combobox will never show anything??
Private Sub MainForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim Combobox1 As New ComboBox
Dim str() As String
str = IO.Directory.GetLogicalDrives
Combobox1.Items.AddRange(str)
'Combobox1.Items.AddRange(IO.Directory.GetLogicalDrives)
End Sub