SlimShady Posted August 20, 2004 Share Posted August 20, 2004 I would like to reset/empty the listboxes. But I can't make it work. I want to click on the refresh button to clear the listboxes. See my script below. expandcollapse popupOpt ("GUINotifyMode", 1) $Width = (@DesktopWidth / 4) * 3 $Height = (@DesktopHeight / 4) * 3 $Title = "File & Dir Compare" GUICreate($Title, $Width, $Height, -1, -1, BitOR(0x00010000, 0x00020000)) Global $List_width $List_width = $Width / 2 - 30 $label_1 = GUISetControl("label", "...", 15, 80, $List_width, 15) GUISetControlEx(-1, 0, 512 + 32, "", 0x000000, 0xffffff) $label_2 = GUISetControl("label", "...", $List_width + 40, 80, $List_width, 15) GUISetControlEx(-1, 0, 512 + 32, "", 0x000000, 0xffffff) $list_left = GUISetControl("list", "ListLeft", 15, 100, $List_width, $Height - 160, BitOR(0x0001, 0x0080, 0x1000)) GUISetControlData(-1, "Item 1|Item 2") $list_right = GUISetControl("list", "ListRight", $List_width + 40, 100, $List_width, $Height - 160, BitOR(0x0001, 0x0080, 0x1000)) GUISetControlData(-1, "Item 1|Item 2") $Refresh_btn = GUISetControl("button", Chr(164), $List_width + 20, $Height / 4, 15, 15, 0x8000) GUISetControlFont(-1, 13, 400, "") $CopyToLeft_btn = GUISetControl("button", Chr(171), $List_width + 20, $Height / 2, 15, 15, 0x8000) GUISetControlFont(-1, 13, 400, "") $CopyToRight_btn = GUISetControl("button", Chr(187), $List_width + 20, $Height / 2 + 20, 15, 15, 0x8000) GUISetControlFont(-1, 13, 400, "") $OK_btn = GUISetControl("button", "OK", $Width / 2 - 80, $Height - 55, 70, 20) GUISetControlEx(-1, 512) $Exit_Btn = GUISetControl("button", "Exit", $Width / 2 + 10, $Height - 55, 70, 20) ;$Filenames_dir1 = ListFiles ($inputdir_1) ;$Filenames_dir2 = ListFiles ($inputdir_2) ;OutPutFilenames ($Filenames_dir1, $Filenames_dir2, $inputdir_1, $inputdir_2) ;ProgressBar ("end", 0) GUIShow() $PrevAct = "" While 1 $msg = GUIMsg() If $msg = -3 OR $msg = $Exit_btn Then GUIDelete() Exit Else GUIWrite($label_1, 256) If $msg = $Refresh_btn Then GUIWrite($list_left, -1, "") GUIWrite($list_right, -1, "") EndIf EndIf Sleep(100) WEnd Link to comment Share on other sites More sharing options...
Valik Posted August 20, 2004 Share Posted August 20, 2004 (edited) Try writing just a pipe character "|".Edit: Oh wait, you have to use GuiSetControlData() on a listbox, not GuiWrite(). Edited August 20, 2004 by Valik Link to comment Share on other sites More sharing options...
SlimShady Posted August 20, 2004 Author Share Posted August 20, 2004 Sh*t... I forgot... It's just confusing that 2 functions do the same: add/change text of controls. Link to comment Share on other sites More sharing options...
CyberSlug Posted August 20, 2004 Share Posted August 20, 2004 An alternative: Func _GuiLB_ResetContent($ref) Return GuiSendMsg($ref, 0x0184, 0, 0);LB_RESETCONTENT EndFunc Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! 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