zhaicheng 0 Posted January 25, 2011 Is there a way to make a click select an item in the list view and keep that item selected when another item is clicked? So, what I want is to single-click items in a list to select them, without needing to hold down the Ctrl or Shift keys. Share this post Link to post Share on other sites
wakillon 403 Posted January 25, 2011 (edited) _GUICtrlListView_GetSelectedIndices ( ) function can help you ! #include <GuiConstantsEx.au3> #include <GuiListView.au3> Global $hListView, $_Selection, $_SelectionOld GUICreate("ListView Get Selected Indices", 400, 300) $hListView = GUICtrlCreateListView("", 2, 2, 394, 268, BitOR($LVS_SHOWSELALWAYS, $LVS_REPORT)) GUISetState() _GUICtrlListView_AddColumn($hListView, "Column 1", 100) _GUICtrlListView_AddItem($hListView, "Item 0") _GUICtrlListView_AddItem($hListView, "Item 1") _GUICtrlListView_AddItem($hListView, "Item 2") _GUICtrlListView_SetItemSelected($hListView, 1) _GUICtrlListView_SetItemSelected($hListView, 2) Do $_Selection = _GUICtrlListView_GetSelectedIndices($hListView) If $_Selection <> '' And $_Selection <> $_SelectionOld Then MsgBox(4160, "Information", "Selected Indices: " & _GUICtrlListView_GetSelectedIndices($hListView)) $_SelectionOld = $_Selection EndIf Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() Edited January 25, 2011 by wakillon AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Share this post Link to post Share on other sites