Clark Posted December 21, 2011 Posted December 21, 2011 Hello, and the best of the festive season to allI'm having trouble working out how to check if ListViewItems are checked or not.The help file says this (my bolding):For Listview items several states can be returned as $GUI_CHECKED and $GUI_UNCHECKED (only for listview controls with LVS_EX_CHECKBOXES-exstyle and on 'advanced' return) . So use i.e. BitAnd(GUICtrlRead($Item),$GUI_CHECKED) to test if the item is checked.So, here is my code, but the msgbox comes up for each and every listviewitem, whether I have checked them or not.Func _Do_Action($action) local $iCntr,$tmp for $iCntr = 1 to $maxActItems ; $tmp = GUICtrlGetState($actItems[$iCntr]) ; I tried this - doesn't work $tmp = BitAnd(GUICtrlRead($actItems[$iCntr]),$GUI_CHECKED) ; $tmp is always 1. if $tmp = 1 Then ; the checkbox is checked msgbox(0,"Check","Item is checked " & GUICtrlRead($actItems[$iCntr])) EndIf next EndFuncAny ideas?
Clark Posted December 21, 2011 Author Posted December 21, 2011 Nice one! That did the job nicely. Thanks
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