Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

visual basic forms acting as a container to other forms

Status
Not open for further replies.

STPMB

Programmer
Sep 13, 2002
28
US
This is my first time into this service so hope someone can help.

Is it possible to set up multiple forms within the boundaries of a current form not using MDI?

Users are requesting that they be allowed to move/resize forms around and then have following forms appear within the boundaries of the current form.

Appreciate any help.

 
Yes, this is possible. By having one main form, and sub-forms of the main form. When you want to show the sub form, you would use code like:

Form2.Show, ME

This would open up the sub form in front of the main form, and it will continue to stay in front ( even if the main form has focus ). When the main form is minimized, the sub form will be as well.

In the Resize event for the sub-form you would have to have code to check where the main form is on the screen, and it's size, and then use code to place the sub form "inside" the main form ( although the main form is not really a "container" ).

The biggest problems with this are that each sub form will show up as an icon on the task bar, and that if you provide a "minimize" button for the sub form, it will minimize to the task bar and not into the application ( like MDI would ).

Just as a question, why don't you want to use MDI?

Robert
 
I think MDI is the best method. I was just wondering how to do display a form within a form without using MDI.
With MDI you can only have one parent form so what if somewhere through an application there is one child form I want displayed within the boundaries of another child form. Will MDI take care of this or do I need to check the boundaries as you suggested?
Thank you
 
As the Vampire said...
Form2.Show, ME

you can also set form properties so that they are not in the task bar.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top