Jump to content

Select Checkbox and unhide submenu

Recommended Posts


I am preparing a code which will have multiple checkboxes. But I do not want to show all the checkboxes or options when the page opens up. I would like only the Option 1 to be visible and when selected Option 1, it will display the submenues with True and False Checkboxes.

These checkboxes would go on displaying more and more so I want the submenues to be displayed only when the above one would be checked.

Could you please help me how to start OFF with this.



Edited by DigDeep

Share this post

Link to post
Share on other sites

I was able to get the results as I needed. There are 2 issues found so far, if someone can help please.

1. When the window opens, Option 1 Check box is highlighted by default.

2. I needed some line spaces before the Option 1 Checkbox would start up. Probably to add a Lable. But the Checkboxes start off just from the extreme top.


; Create flag to indicate item selection change
Global $ItemSelected = False
; Create array to hold item data
Global $TreeMenu[13][3]

; Create GUI
Global $Form1 = GUICreate("Form1", 1896, 984, 3, 2, BitOR($GUI_SS_DEFAULT_GUI, $WS_MAXIMIZEBOX, $WS_SIZEBOX, $WS_THICKFRAME, $WS_TABSTOP))

; Create TreeView

; TreeView Details
$TreeMenu[0][2]  = GUICtrlCreateTreeViewItem("Option 1", $TreeList)
$TreeMenu[1][2]  = GUICtrlCreateTreeViewItem("True", $TreeMenu[0][2])
$TreeMenu[2][2]  = GUICtrlCreateTreeViewItem("ABC", $TreeMenu[1][2])
$TreeMenu[3][2]  = GUICtrlCreateTreeViewItem("False", $TreeMenu[0][2])
$TreeMenu[4][2]  = GUICtrlCreateTreeViewItem("DEF", $TreeMenu[3][2])
$TreeMenu[5][2]  = GUICtrlCreateTreeViewItem("GHI", $TreeMenu[4][2])
$TreeMenu[6][2]  = GUICtrlCreateTreeViewItem("MayBe", $TreeMenu[0][2])
$TreeMenu[7][2]  = GUICtrlCreateTreeViewItem("JKL", $TreeMenu[6][2])

$TreeMenu[7][2]  = GUICtrlCreateTreeViewItem("option 2", $TreeList)
$TreeMenu[8][2]  = GUICtrlCreateTreeViewItem("True", $TreeMenu[7][2])
$TreeMenu[9][2]  = GUICtrlCreateTreeViewItem("MNO", $TreeMenu[8][2])
$TreeMenu[10][2]  = GUICtrlCreateTreeViewItem("False", $TreeMenu[7][2])
$TreeMenu[11][2]  = GUICtrlCreateTreeViewItem("PQR", $TreeMenu[10][2])
$TreeMenu[12][2]  = GUICtrlCreateTreeViewItem("STU", $TreeMenu[11][2])


Share this post

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...