Hi,
I see there are various threads on determining if a listview's checkboxes are checked or not,
by looping through the rows, but how do you actually set a single checkbox, on its own?
Brian
DEF d1:DIALOG
DEF D1_L1=100:INT ' Listview
DEF t1:INT ' Index into Listiview, remember 0 based
' Set Flag on
SetCheckState(d1,D1_L1,t1,1)
SUB SetCheckState(win:DIALOG,cid:INT,index:INT,ticked:INT)
DEF litem:LVITEM
litem.mask=LVIF_STATE
IF ticked THEN ticked = 0x2000 ELSE ticked = 0x1000
litem.state=ticked
litem.stateMask=LVIS_STATEIMAGEMASK
SENDMESSAGE(win,LVM_SETITEMSTATE,index,litem,cid)
RETURN
ENDSUB
SUB GetCheckState(win:DIALOG,cid:INT,index:INT),INT
DEF nState:INT
'State image 1 is the unchecked box, and state image 2 is the checked box.
'Setting the state image To zero removes the check box altogether.
nState=(SENDMESSAGE(win,LVM_GETITEMSTATE,index,LVIS_STATEIMAGEMASK,cid))/4096
RETURN (nState=2)
ENDSUB
To set off, change 1 to 0.
Bill
Thanks, Bill - I'll give that a whirl
Brian