View Full Version : NewB - Bringing Controls to the Front of a Form
plinydogg
10-27-2006, 11:17 PM
Hi everyone,
I've got a tab control stretched across the screen. When I add new controls (buttons, etc.) they don't appear when I run the program. I'm assuming I need to use some kind of bringToFront() function. Is there such a thing? If so, what is the syntax? If not, how do I make it so that all of a form's controls are displayed?
Thanks!
bmanske
10-28-2006, 05:38 AM
plinydogg,
A Tab Control probably doesn't do as much for you as you are assuming. It really does very little. It draws the tabs, defines an area for the controls to operate in, passes notification messages, but that is just about it.
Take the dialog for changing the properties of a control. Briefly, this is how it works. On the form, I defined a tab control and I defined 4 list boxes. Each list box holds the entries that get displayed when a tab is selected. When opening the dialog, I get the client area of the tab control and move and resize each of the list boxes. Each list box is made a child of the tab control, so that it is in the proper coordinate system and so that notification messages get passed properly.
Up to this point, the Tab control really hasn't done any work. Once the dialog is opened, The tab control will notify you if changing to a new tab. In the case above, When a tab is closing, the list box is hidden and then when the message is received that a new tab is activated, the correct listbox is shown.
There is not much else to tell. It draws itself and notifies you of changes.
In the future we will add more functionality to wrap a tab control to allow you to place controls and have them show up automatically, but for now you have to do it the hard way.
There is some good information on MSDN. Look up Tab Control. The example I talked about above is in DialogOpen.PPL in the VFB project.* The handler for the tab control is on the ControlEdit.FRM file.
The short answer is
SetParent(ControlName$, TabControl$);
I hope that this gets you started. Let us know if you have more problems.
Brad
plinydogg
10-28-2006, 03:57 PM
Brad, thanks for the detailed response. I think I might stay away from tabs for the time being and concentrate more on learning other aspects of PPL =)
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.