When I run my program and get it to give me the value (Yes, I do have the items in the drop down list selected) in the combo-box all I get is this,
System.Windows.Forms.ComboBox+ObjectCollection
This is the code I am using
Dim name As String
name = cmbworld.Text
MsgBox(name)
Any ideas?
P.S. The code I used to insert the values is
cmbworld.Items.Clear()
If File.Exists(root + "\setting\world.txt") Then
For Each line As String In File.ReadLines(root + "\setting\world.txt")
If line.Length <> 0 Then
cmbworld.Items.Add(line)
End If
Next line
Else
This code would reproduce the problem:
You have some other code somewhere that is assigning the value of the Text property incorrectly. You need to index the Items collection. For example: