MISIIM Posted November 8, 2007 Posted November 8, 2007 (edited) After upgrading to the latest beta the function I used in a loop to select all items was removed. I tried both _GUICtrlListView_SetItemSelected and _GUICtrlListView_SetItemState. Both deselected any other items. Is there another way to select all items? Func SelectAll() Local $index = -1; While True $index = _GUICtrlListView_GetNextItem($listView, $index, 0, 0); If $index == $LV_ERR Then ExitLoop; _GUICtrlListView_SetItemState($listView, $index, $LVIS_SELECTED, $LVIS_SELECTED); WEnd EndFunc Edited November 8, 2007 by MISIIM
smashly Posted November 9, 2007 Posted November 9, 2007 (edited) Hi, works for me .. eg:#include<GuiConstants.au3> #include<GuiListView.au3> Global $State GUICreate(":-)", 400, 300) $listview = GUICtrlCreateListView ("col1 |col2|col3",10,10,380,250, $LVS_SHOWSELALWAYS) For $i = 1 to 20 GUICtrlCreateListViewItem("item" & $i & "|data" & $i & "|more" & $i,$listview) Next $button = GUICtrlCreateButton("Select All", 160, 270, 80, 20) GUISetState() While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit Case $button If Not $State Then For $i = 0 To _GUICtrlListView_GetItemCount($listview) -1 _GUICtrlListView_SetItemState($listView, $i, $LVIS_SELECTED, $LVIS_SELECTED) Next GUICtrlSetData($button, "UnSelect All") GUICtrlSetState($listView, $GUI_FOCUS) $State = 1 Else For $i = 0 To _GUICtrlListView_GetItemCount($listview) -1 _GUICtrlListView_SetItemState($listView, $i, 0, $LVIS_SELECTED) Next GUICtrlSetData($button, "Select All") $State = 0 EndIf EndSwitch WEndDone using Autoit v3.2.9.6 (beta) Cheers Edited November 9, 2007 by smashly
MISIIM Posted November 9, 2007 Author Posted November 9, 2007 Ahhh! I accidentally reset the style parameter for GUICtrlCreateListView so only one could be selected.
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