Tabpage form resizing - has this been simplified?
I have a classic mdi main form in Explorer style with a split container. Panel ! has a treeview and Panel 2 has a tab control. Clicking on a treeview node opens a winform in a tabpage.
I can load the tabpage form maximized with no problem but its the resize that's giving me headaches. When the MDI parent is resized I need for the tab control to trigger the form resize event so that it corresponds with the new size of panel 2, hence the new tabpage size. Extra bonus if fonts would also increase and decrease also.
I know that VB6 never achieved this without a 3rd party shrinker/stretcher, did MS give us something for this age old dilemma?
I have been Anchoring and Docking and use table layout panels but never see the big result.
Re: Tabpage form resizing - has this been simplified?
This worked ok when I tried it:
Code:
Public Class Form1
'code in mdiform
Private Sub Form1_Shown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shown
Dim frm As New Form2
frm.TopLevel = False
frm.Parent = Me.TabPage1
frm.Dock = DockStyle.Fill
frm.Show()
Me.TabPage1.Dock = DockStyle.Fill
Me.TabPage2.Dock = DockStyle.Fill
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.SplitContainer1.Dock = DockStyle.Fill
Me.TabControl1.Dock = DockStyle.Fill
End Sub
End Class