I found 3 main approaches to this (there are probably more, but these accomplish the stated goal without excessive coding):
1. the MDIWindowManager project (free under BSD license)
2. the DockPanel Suite project (free, from SourceForge)
3. do-it-yourself (VB.Net code)
Private Sub AddFormToTab(ByVal objForm As Form, ByRef objTabPage As TabPage)
objForm.TopLevel = False
objForm.Text = ""
objForm.MaximizeBox = False
objForm.MinimizeBox = False
objForm.ControlBox = False
objTabPage.Controls.Add(objForm)
objForm.Dock = DockStyle.Fill ' Expands the form to fill the tabpage
objForm.Show()
End Sub
Use this method in the main form to add a form to a tab page.
The do-it-yourself method is simple and works, the other 2 links with the accompanying source code provide more functionality.
No comments:
Post a Comment