need code that creates a ListBox, reads the entries from the "MyList.txt" file, and selects the first entry
i try make this but not rly work
Code: Select all
Gui +Resize
Gui Add, ListBox, vMyList w200 h120,
if FileExist("MyList.txt")
{
FileRead, Contents, MyList.txt
StringReplace, Contents, Contents, `r, ,All
Loop, Parse, Contents, `n
{
ThisEntry := Trim(A_LoopField)
GuiControl,, MyList, Add, %ThisEntry%
}
GuiControl,, MyList, Select, 1
}
else
{
MsgBox, 16, Error, The file MyList.txt could not be found.
ExitApp
}
Gui Show
return
[Mod action: Moved topic to v1 section. The main section is for v2.]