Jump to content
Sign in to follow this  

How to create elements in a Groupbox container ?

Recommended Posts

Hi every body,

I come from France and I hope you'll be able to help me, which is not possible on French forums ...

Here is my problem / question :

I want to create a form which generates check boxes dynamically. It reads recursively folders on a disk and create a check box for each folder there is on the hard drive. I would like to place them in order to see the tree, so that I firstly used a Tree view component with check boxes. I had some problem with that component because I have to take back some data on the final processing (witch check box has been selected and what's the full path of the folder, etc ...).

I've replaced this tree view by some check boxes. I want them to be placed as the tree, like that

[ ] Folder 1

___[ ] Sub folder 1

___[ ] Sub folder 2

______[ ] Sub² folder 1

______[ ] Sub² folder 2

___[ ] Sub folder 3

I have no problem to do that in an absolute positioning (from the top left corner of the form). Because the number of folder can become huge, the form may grow too much, that's why I want to put check boxes in a group box with a vertical scrollbar.

I tried to put check boxes relatively with Opt("GUICoordMode", 0), the problem is the same than with an absolute x and y :

Check boxes are not in the group box container : see the attachment


You see, check boxes are out of the container on the bottom : they're on the button witch is not in the container !

Here is the code :

; Here is the start of the group box
$GroupBox = GUICtrlCreateGroup("Pour qui placer un raccourci, et où le placer ?", 16, 140, 305, 275, $WS_VSCROLL)

; Here I call my recursive function which browse folders on the disk
; This function creates check boxes and labels like that

$TabItems[$i]["object"] = GUICtrlCreateCheckbox($File, 25 + ($Level * 20), 150 + ($i * 20), 17, 17)
$TabItems[$i]["label"] = GUICtrlCreateLabel($File, 45 + ($Level * 20), 150 + ($i * 20), 200, 17)
$TabItems[$i]["fullpath"] = $FullFilePath
$TabItems[$i]["parent"] = $SourceFolder

; Here is the end of the group box
GUICtrlCreateGroup("", -99, -99, 1, 1)

How can I do to create object IN the groupbox container in order to use the scrollbar ?

Thank you in advance for your help ! And sorry for my bad english !


Edited by CleM71

Share this post

Link to post
Share on other sites

I haven't been able to find a solution to your problem :)

I tried alot of things and none worked - maybe the $WS_VSCROLL is not intended to work with groups.

I might be wrong about this and I'm waiting to see if some1 finds a way to solve this.

In my opinion you should stick to using a TreeView; that works and you might get help on that matter.

Try that and post here the code.

SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...