Movable 'container' control ?

klaus

Expert
Licensed User
Longtime User
Does there exist a movable 'container' control allowing an image and other controls on it?
In my DynSim program I would like to move up the sketch of the control unit with it's Textboxes and ImageButtons when using the soft input panel. Just in changing the Panel.Top property instead of redrawing the image and move all controls seperately.
- the Panel control doesn't accept an image but allows other controls.
- the Image control accepts an image but doesn't allow any controls.
- the Form control cannot be moved

A Panel doesn't accept another panel as a child control, is this a .NET limitation or a B4PPC limitation?
This feature would be interesting to separate different RadioButtons on a Panel and not only on a Form.

Thank you in advance and Best regards.
 

sahoopes

Member
Licensed User
Can you use a panel and and image control to handle the background? Then place more control over the image control but on the same panel?
 

willisgt

Active Member
Licensed User
True, a panel does not accept another panel - not normally, anyway. It is possible, however, to create two panels on the same form, one as a 'parent', the other as a 'child', then use formlib.ChangeParent to cause the child panel to become subordinate to the parent panel.

I commonly use this approach, and add a scrollbar to the parent panel which causes the child panel to move up and down. It allows me to put a great many more controls on a single form than would fit otherwise.

Gary
 

klaus

Expert
Licensed User
Longtime User
Thank you both.
It works.
I didn't think about adding an Image control on the panel.
I had tried to change the parent property in the Designer but not with FormLib.ChangeParent
Why does it work with the FormLib and not in the Designer ?

Best regards
 
Last edited:

willisgt

Active Member
Licensed User
I have no idea why the designer won't do this; however, I failed to mention that it is also possible to create the panels dynamically, and specify one as the parent of the other. This omits the need for the FormLib library, if that's all you're using it for.

Gary
 
Top