SlimShady 1 Posted August 18, 2004 Why does a listbox not tell me when a user has clicked in it? See following example script. Opt ("GUINotifyMode", 1) $Width = (@DesktopWidth / 4) * 3 $Height = (@DesktopHeight / 4) * 3 GUICreate("File & Dir Compare", $Width, $Height, -1, -1, BitOR(0x00010000, 0x00020000)) Global $List_width $List_width = $Width / 2 - 30 GUISetControl("label", "...", 15, 80, $List_width, 15) GUISetControlEx(-1, 0, 512 + 32, "", 0x000000, 0xffffff) 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(0x0080, 0x1000)) GUISetControlData(-1, "List left - item 1|List left - item 2|List left - item 3") $list_right = GUISetControl("list", "ListRight", $List_width + 40, 100, $List_width, $Height - 160, BitOR(0x0080, 0x1000)) GUISetControlData(-1, "List right - item 1|List right - item 2|List right - item 3") $OK_btn = GUISetControl("button", "OK", $Width / 2 - 80, $Height - 55, 70, 20) $Exit_Btn = GUISetControl("button", "Exit", $Width / 2 + 10, $Height - 55, 70, 20) GUIShow() While 1 $msg = GUIMsg() Select Case $msg = -3 OR $msg = $Exit_Btn GUIDelete() Exit Case $msg > 0 MsgBox(0, "", "You clicked on control ref number: " & $msg) EndSelect Sleep(100) WEnd MsgBox(0, "", "You clicked on control ref number: " & $msg) Share this post Link to post Share on other sites
Jos 2,175 Posted August 18, 2004 You will have to add LBS_NOTIFY (0x0001) value to the listbox ControlStyle.... (think this one in not documented..) $list_left = GUISetControl("list", "ListLeft", 15, 100, $List_width, $Height - 160, BitOR(0x0001, 0x0080, 0x1000)) SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Share this post Link to post Share on other sites
Josbe 1 Posted August 18, 2004 You will have to add LBS_NOTIFY (0x0001) value to the listbox ControlStyle.... (think this one in not documented..) $list_left = GUISetControl("list", "ListLeft", 15, 100, $List_width, $Height - 160, BitOR(0x0001, 0x0080, 0x1000)) <{POST_SNAPBACK}>Yeah, when you override the default styles for a control, you need add notify value(in some cases), like JdeB said.(although "notify mode" is activated) AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta Share this post Link to post Share on other sites
SlimShady 1 Posted August 18, 2004 I see... Thanks. Share this post Link to post Share on other sites