Jump to content

Combobox - reading from a text file


mcgill
 Share

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.")

Exit

EndIf

; 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)

WEnd

FileClose($file)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...