GordonFreeman Posted November 20, 2013 Posted November 20, 2013 (edited) I guys! I have an simple listview control with exstyle ($LVS_EX_CHECKBOXES) and i need get item state (Checked or not). I tried: $r = GUICtrlSendMsg($LVI1, $LVM_GETITEMSTATE, 1, $LVIS_SELECTED) $r2 = GUICtrlRead($LVI1) GUICtrlSetState($LVI1,$GUI_CHECKED) MsgBox(0,"", $r & "|" & $r2) With and without guictrlsetstate but return same result if checked or not. Guictrlsetstate is working fine! I trying without include listview native udf my listview code: $ListView1 = GUICtrlCreateListView("Software|Instalador|Comando", 16, 32, 585, 337,-1,BitOR($LVS_EX_CHECKBOXES,$LVS_EX_GRIDLINES)) Edited November 20, 2013 by GordonFreeman Frabjous Installation
Moderators Melba23 Posted November 20, 2013 Moderators Posted November 20, 2013 GordonFreeman,if you look in the Helpfile under <User Defined Function Reference - GUI Reference - GuiListView user defined functions Reference> you will find the _GUICtrlListView_GetItemChecked function - which is exactly what you need. 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
GordonFreeman Posted November 20, 2013 Author Posted November 20, 2013 (edited) GordonFreeman, if you look in the Helpfile under <User Defined Function Reference - GUI Reference - GuiListView user defined functions Reference> you will find the _GUICtrlListView_GetItemChecked function - which is exactly what you need. M23 Ok. I will use it. And i will use all code with GuiListview.au3 Is not good idea misc normal listview controls with functions of this include right?! Thanks Melba! Edited November 20, 2013 by GordonFreeman Frabjous Installation
Moderators Melba23 Posted November 20, 2013 Moderators Posted November 20, 2013 GordonFreeman, i will use all code with GuiListview.au3No need - most of the UDF functions work with the native ListView control as well - and that is usually easier to code. But I would certainly recommend that you create the items the same way (native/UDF) that you create the ListView - mixing those 2 is very likely to end in tears. 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
GordonFreeman Posted November 20, 2013 Author Posted November 20, 2013 (edited) Ok. We resolve the problem with checked states: GUICtrlSetState($LVI1,$GUI_CHECKED) $r = _GUICtrlListView_GetItemChecked($ListView1,0) MsgBox(0,"",$r) Working! Now i have other problem. I need Disable a item of listview and get state. I tried: GUICtrlSetState($LVI1,$GUI_DISABLE) MsgBox(0,"",GUICtrlGetState($LVI1)) No sucess, control was not disabled and i got the same state (80) And i not now how i can use _GUICtrlListView_SetItemState Edited November 20, 2013 by GordonFreeman Frabjous Installation
Moderators Melba23 Posted November 20, 2013 Moderators Posted November 20, 2013 GordonFreeman,You cannot "disable" a ListView item - but you can remove the checkbox like this. 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
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