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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple forms

Status
Not open for further replies.

jabond007

Programmer
Jun 21, 2000
39
US
I have a MDI form with many child forms.<br><br>When i open all the forms they are loaded and visible. I am loading forms through the menus provided. Once all the forms are loaded they are listed in the windows menu. <br><br>When i click the menus again the form does not come to the foreground. But when i select it from the windows list menu i get it in the foreground. <br>I need to get the form in the foreground when a person clicks on the menu. How do i do it?
 
You are loading the forms, not showing them. Just loading a form will not show them. If your method works (When you load them for the first time using menus on MDI form), it is because of a property named AutoShowChildren related to MDI form. This tells VB to show the child forms as soon as they are loaded.

So what really happens is:

-You load the child form using Load FormName.
- VB invokes Show method since AutoShowChildren is set to True.
- The window becomes the Active (foreground) since Show method was called implicitly by VB.

So the solution is to use FormName.Show instead of Load FormName. Don't worry about not loading the forms for the first time, since VB will automatically do it for you if you don't load them.
 
Hi,
I feel like this could also be a solution for ur problem.
There's a property by name zorder for the form which will bring the form to the foreground which is already open but in the background.I hope this is ur problem.
If so here is the solution.
form1.show
form1.zorder(0).

Regards,
K.Purushothaman.
Software Engineer,
California Software.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top