Movable 'container' control ?

Discussion in 'Questions (Windows Mobile)' started by klaus, Mar 31, 2008.

  1. klaus

    klaus Expert Licensed 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.
  2. sahoopes

    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?
  3. willisgt

    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.

  4. klaus

    klaus Expert Licensed 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: Apr 2, 2008
  5. willisgt

    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.

  6. klaus

    klaus Expert Licensed User

    Hi Gary
    Thank you for the complemetary information.
    I am not yet used to add controls dynamically, but will do it in the next programs. It would probably be easier for modifications.

    Best regards
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice