maniootek Posted March 26, 2016 Share Posted March 26, 2016 (edited) When i combine style "$LVS_EX_CHECKBOXES" and "$LVS_EX_AUTOCHECKSELECT" it only check one item from list view. How to let it check more than one item? #include <GUIConstantsEx.au3> ;for $GUI_EVENT_CLOSE #include <GUIListView.au3> Example() Func Example() GUICreate("gui") Local $idListview = GUICtrlCreateListView("col1|col2|col3|", 10,10) _GUICtrlListView_SetExtendedListViewStyle($idListview, BitOr($LVS_EX_CHECKBOXES, ,$LVS_EX_AUTOCHECKSELECT,$LVS_EX_AUTOSIZECOLUMNS, $LVS_EX_FULLROWSELECT, $LVS_EX_GRIDLINES)) for $i=0 to 5 GUICtrlCreateListViewItem($i & "|name|1" , $idListview) Next GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd EndFunc Edited: or is it possible only for Vista? Quote Global Const $LVS_EX_AUTOCHECKSELECT = 0x08000000 ; Vista - Automatically select check boxes on single click Edited March 26, 2016 by maniootek Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 26, 2016 Moderators Share Posted March 26, 2016 maniootek, As explained in the Help file, the ListView is created with the $LVS_SINGLESEL style as default. If you set the styles to remove that you can indeed select multiple items as long as you press the Ctrl key while so doing: #include <GUIConstantsEx.au3> ;for $GUI_EVENT_CLOSE #include <GUIListView.au3> Example() Func Example() GUICreate("gui") Local $idListview = GUICtrlCreateListView("col1|col2|col3|", 10, 10, 200, 200, $LVS_SHOWSELALWAYS) _GUICtrlListView_SetExtendedListViewStyle($idListview, BitOR($LVS_EX_CHECKBOXES, $LVS_EX_AUTOCHECKSELECT, $LVS_EX_AUTOSIZECOLUMNS, $LVS_EX_FULLROWSELECT, $LVS_EX_GRIDLINES)) For $i = 0 To 5 GUICtrlCreateListViewItem($i & "|name|1", $idListview) Next GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd EndFunc ;==>Example All the $LVS_EX_AUTOCHECKSELECT extended style appears to do is automatically check the checkbox when an item is selected - and limit checkbox visibility to selected items. Without it all checkboxes are permanently visible and are divorced from item selection. Either functionality may be useful may be useful depending on the particular case, but I am struggling to come up with a circumstance when I would wish to use this extended style. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area 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