Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
125
Change position of new created tab
posted

 

When i open a new form inside the wintabbedmdi the new tab is placed at the end of the existing tabs.

Is it possible to place the new tab just next to the tab where I code newForm.Show()?

 

Thanks

  • 5389
    Verified Answer
    posted

    h0mer,

    Try using the UltraTabbedMdiManager's TabFromForm() method to get a reference to the tab that was created, then use its Reposition() method to move it.  For example:

                Form2 f2 = new Form2();
                f2.MdiParent = this;
                f2.Show();

                Form3 f3 = new Form3();
                f3.MdiParent = this;
                f3.Show();

                Form2 f22 = new Form2();
                f22.MdiParent = this;
                f22.Show();

                MdiTab tab = this.ultraTabbedMdiManager1.TabFromForm(f22);
                tab.Reposition(this.ultraTabbedMdiManager1.TabFromForm(f2), MdiTabPosition.Next);

     

    By default, f22 would show at the end of the group (after F3), however, using tab.Reposition(), I have moved it from the end to the middle, making it the next tab after f2's tab.

    Hope this helps,

    ~Kim~