Justen Posted October 12, 2008 Share Posted October 12, 2008 (edited) I'm new to AutoIt3, and I would like to clear the GUI List control of all data. So it will be cleared. I was thinking it can be done with GUICtrlSetData. But I do not know what message needs to be sent. (This isn't the full script) $List1 = GUICtrlCreateList("Accounts", 112, 40, 161, 227) Func Event_Button1() $UsernamePath = FileOpenDialog ("Select Account List...", @ScriptDir, "Text files (*.txt)", 1, "Accounts.txt") LoadAccountArray() ;Here is where we clear the list control For $i = 1 to $Account[0] GuiCtrlSendMsg($List1, 0x0180, 0, $Account[$i]) Next Return EndFunc func LoadAccountArray() $Account = StringSplit (FileRead($UsernamePath), Chr(10)) For $i = 1 to $Account[0] $Account[$i] = StringStripCR($Account[$i]) Next EndFunc Any thoughts? Edited October 12, 2008 by Justen Link to comment Share on other sites More sharing options...
ResNullius Posted October 12, 2008 Share Posted October 12, 2008 Yes, use GuiCtrlSetData, simple like this: Func Event_Button1() $UsernamePath = FileOpenDialog ("Select Account List...", @ScriptDir, "Text files (*.txt)", 1, "Accounts.txt") LoadAccountArray() GuiCtrlSetData($List1,"");Here is where we clear the list control For $i = 1 to $Account[0] GuiCtrlSendMsg($List1, 0x0180, 0, $Account[$i]) Next Return EndFunc Link to comment Share on other sites More sharing options...
Justen Posted October 12, 2008 Author Share Posted October 12, 2008 Yes, use GuiCtrlSetData, simple like this: Func Event_Button1() $UsernamePath = FileOpenDialog ("Select Account List...", @ScriptDir, "Text files (*.txt)", 1, "Accounts.txt") LoadAccountArray() GuiCtrlSetData($List1,"");Here is where we clear the list control For $i = 1 to $Account[0] GuiCtrlSendMsg($List1, 0x0180, 0, $Account[$i]) Next Return EndFunc This is exactly what I needed. Thank you . Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now