Using Forms as Child Controls of Tool or Document Windows

Docking/MDI for Windows Forms Forum

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Just wanted to post this information since several users have asked about using Forms as child controls of tool and document windows.

UIStudio fully supports this although you need to make two property changes to the Form before adding it to a tool or document window.

1) Forms are not visible by default whereas Controls are. Be sure to set the Form.Visible property to true before adding the Form so that it is visible.

2) Set the Form.TopLevel property to false before adding the Form. Otherwise, the .NET framework will throw an exception.

If you do those two things, you'll be good to go!

In practice, we think it's easier to use UserControls instead of Forms for contained functionality since they provide the same code encapsulation features but don't require these extra steps.


Actipro Software Support

Comments (2)

Posted 14 years ago by Wyatt Albiston - Software Engineer, Bill Good Marketing
Avatar
Maybe I'm dumb but I can't see how to use forms as child controls of tool and document windows. The above explanation dose not shed any light on it for me. Would it be possible to provide a bit more info on how to get the tool window to display a form?

Thanks,
Wyatt
Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
It's pretty straightforward. If you just set the two properties of the child Form to the values we said (in our post above) before you add the child Form to the tool window, it will act like any other normal child control.


Actipro Software Support

The latest build of this product (v2018.1 build 0341) was released 6 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.