Link to home
Start Free TrialLog in
Avatar of fieldb1
fieldb1Flag for United States of America

asked on

Designing Child Form Layout in VB.NET

I have an MDI Parent form, in which I dock multiple child forms which contain a custom menu strip, TreeView, etc. In the MDI Parent form_loading event I instantiate two forms and dock them to the left and top of the Parent form, respectively. When I instantiate a third form and set it to fill the Parent, on load it behaves correctly and fills the remaining space. However, when the menu strip receives focus, the third child form slides underneath the menu strip as if the menu strip form executed a Me.BringToFront method.

I have coded methods to counteract any form going forward or backward upon getting / loosing, but the problem remains. It's driving me crazy. Any help is greatly appreciated.
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

Can you show a screen shot of the layout please?
Avatar of fieldb1

ASKER

I think we'd need to see some code and understand better how the subforms were built...
Avatar of fieldb1

ASKER

Got it!

In the TreeView_GotFocus event I placed the following code:
If Not anAccountForm Is Nothing Then
            anAccountForm.BringToFront()
            Me.SendToBack()
        End If

Thank God! I've been banging my head on this.
In the picture, which controls are part of what form(s)?

Are you really using MDI here?...or setting TopLevel to False and embedding the forms?
Avatar of fieldb1

ASKER

I'm using an MDI Parent yes.

In the picture, the parent form consists of a toolstrip and status strip
The left hand child form contains the treeview
The middle child currently contains textboxes.

What is this TopLevel to false useful for?
Avatar of fieldb1

ASKER

You wouldn't know the TSQL syntax for inserting rows from one database into a table in a different database, would you? I'm using fully qualified names, but it throws an error.
No, sorry...I'm not a DB guy.
ASKER CERTIFIED SOLUTION
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of fieldb1

ASKER

I fixed it (see my earlier post) but I accept this as a good alternative. Thanks.