|
-
Feb 17th, 2006, 07:08 PM
#1
Thread Starter
Lively Member
[RESOLVED] MDI Child on Tab of parent.
Hi,
I have 3 forms loading to memory in sub main()
The first form is "frm_Main". Which is the main form. The other two are "frm_1" and "frm_2" which are MDI children of frm_Main. All forms are loaded to memory "as New frm_OriginalForm" (whatever the original is) and the frm_XX name is accessible from any module or form in the project.
Currently, everything works, however I wish to place a tab control on "frm_Main" and put "frm_1" in tab index 0 and "frm_2" in tab index 2 so that these forms can be tabbed between by the user.
However, when I put the tab control on my "frm_Main" it covers up the two forms which are currently underneath it. Also, I have no idea where to go from here. Keep in mind that the two children forms are created in run time and are set to be the children in sub main.
Any help would be appreciated.
Best Regards,
Luc L.
-
Feb 17th, 2006, 07:21 PM
#2
Re: MDI Child on Tab of parent.
you can use the SetParent api to make the tabpage a parent of the child forms
VB Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim f As New Form
f.Show()
SetParent(f.Handle.ToInt32, Me.TabPage1.Handle.ToInt32)
End Sub
hth
kevin
ps...
this only works if form child form runs in the same thread as the parent. Children can't be parented to controls on different threads
Last edited by kebo; Feb 17th, 2006 at 07:25 PM.
Process control doesn't give you good quality, it gives you consistent quality.
Good quality comes from consistently doing the right things.
Vague general questions have vague general answers. A $100 donation is required for me to help you if you PM me asking for help. Instructions for donating to one of our local charities will be provided.
______________________________ Last edited by kebo : Now. Reason: superfluous typo's
-
Feb 17th, 2006, 07:37 PM
#3
Thread Starter
Lively Member
Re: MDI Child on Tab of parent.
thanks. that did the trick, though i was hoping for a non-api approach.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|