Jump to content
Sign in to follow this  

Combobox - reading from a text file

Recommended Posts

I am trying to read information from a textfile into a combobox but nothing is displaying in my combobox when I run my program. I can get it to work in a listview but not a combobox, if anyone can help me that would be great.

$Combo_1 = GUICtrlCreateCombo("", 50, 10, 150, 21)

$file = FileOpen($cityservers, 0)

; Check if file opened for reading OK

If $file = -1 Then

MsgBox(0, "Error", "Unable to open file.")



; Read in lines of text until the EOF is reached

While 1

$line = FileReadLine($file)

If @error = -1 Then ExitLoop

$x = StringFormat("%s", $line)

GUICtrlSetData($Combo_1, $x)



Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Create New...