Results 1 to 2 of 2

Thread: Tabpage form resizing - has this been simplified?

  1. #1

    Thread Starter
    Addicted Member Smartacus's Avatar
    Join Date
    Oct 2009
    Location
    Deep South, USA
    Posts
    196

    Red face 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.
    ***************************************************
    Smartacus comes packaged "As Is With No Warranty"

    ************* Useful Links ******************
    FAQs: Index / Database Development / .NET CodeBank /
    Before Posting Here...MSDN

    MZTools (I love this tool when using VB6 - Free) /

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,413

    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

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width