treeview remove all checkboxes

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Guest

treeview remove all checkboxes

17 Mar 2018, 17:42

Hi, I have searched but can not figure out how to make this work.
I can show them but can not figure out how to remove them.
I appreciate any input.
Thank you

Code: Select all

LB:="myTree1"
Gui, Add, TreeView, AltSubmit v%LB% h100
P1 := TV_Add("First parent",,"expand")
P1C1 := TV_Add("Parent 1's first child", P1)  ; Specify P1 to be this item's parent.
P2 := TV_Add("Second parent",,"expand")
P2C1 := TV_Add("Parent 2's first child", P2)
P2C2 := TV_Add("Parent 2's second child", P2,"expand")
P2C2C1 := TV_Add("Child 2's first child", P2C2)
Gui, Add, Button, y+5 w120 h20 gCH, Make Checked
Gui, Add, Button, x+10 w120 h20 guCH, Remove Checkboxes
Gui, Show  ; Show the window and its TreeView.
return

CH:
;~ GuiControl, -Redraw, %LB%
GuiControl, +0x100, %LB%
;~ GuiControl, +Checked, %LB%
;~ GuiControl, +Redraw, %LB%
return

uCH:
;~ GuiControl, -Redraw, %LB%
GuiControl, -0x100, %LB%
;~ GuiControl, -Checked, %LB%
;~ GuiControl, +Redraw, %LB%
return

Esc::
GuiClose:
ExitApp
bish01
Posts: 96
Joined: 22 Feb 2016, 03:57

Re: treeview remove all checkboxes

17 Mar 2018, 18:16

sorry I posted original message as a guest.

This is the only way I know how to do it... deleting and re-creating tv items after "GuiControl, -0x100..." but not sure if correct.
Cheers

Code: Select all

LB:="myTree1"
Gui, Add, TreeView, AltSubmit v%LB% h100
gosub addtvitems
Gui, Add, Button, y+5 w120 h20 gCH, Make Checked
Gui, Add, Button, x+10 w120 h20 guCH, Remove Checkboxes
Gui, Show  ; Show the window and its TreeView.
return

addtvitems:
P1 := TV_Add("First parent",,"expand")
P1C1 := TV_Add("Parent 1's first child", P1)  ; Specify P1 to be this item's parent.
P2 := TV_Add("Second parent",,"expand")
P2C1 := TV_Add("Parent 2's first child", P2)
P2C2 := TV_Add("Parent 2's second child", P2,"expand")
P2C2C1 := TV_Add("Child 2's first child", P2C2)
return

CH:
GuiControl, -Redraw, %LB%
GuiControl, +0x100, %LB%
GuiControl, +Redraw, %LB%
return

uCH:
GuiControl, -Redraw, %LB%
GuiControl, -0x100, %LB%
TV_Delete()
gosub addtvitems
GuiControl, +Redraw, %LB%
return

Esc::
GuiClose:
ExitApp

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: mcd, slowwd and 228 guests