Note that there are some explanatory texts on larger screens.

plurals
  1. POTab not selecting with change in selected form
    primarykey
    data
    text
    <p>i have a tabforms in my application and whenever i open the multiple forms the tabs open in usual manner but whenever i open the form which is already opened the selected tab doesnt get changed.it gets stuck to the tab which is opened at last.My code is here.</p> <pre><code>private void Form1_MdiChildActivate(object sender, EventArgs e) { if (this.ActiveMdiChild == null) tabForms.Visible = false; // If no any child form, hide tabControl else { this.ActiveMdiChild.WindowState = FormWindowState.Maximized; // Child form always maximized // If child form is new and no has tabPage, // create new tabPage if (this.ActiveMdiChild.Tag == null) { // Add a tabPage to tabControl with child // form caption TabPage tp = new TabPage(this.ActiveMdiChild.Text); tp.Tag = this.ActiveMdiChild; tp.Parent = tabForms; tabForms.SelectedTab = tp; SwapTabPages(tp); this.ActiveMdiChild.Tag = tp; this.ActiveMdiChild.FormClosed += new FormClosedEventHandler(ActiveMdiChild_FormClosed); } if (!tabForms.Visible) tabForms.Visible = true; } } private void ActiveMdiChild_FormClosed(object sender, FormClosedEventArgs e) { //Destroy the corresponding Tabpage when closing MDI child form if (tabForms.HasChildren) { ((sender as Form).Tag as TabPage).Dispose(); } //If no Tabpage left else if (!tabForms.HasChildren) { tabForms.Visible = false; } } private void tabForms_SelectedIndexChanged(object sender, EventArgs e) { if ((tabForms.SelectedTab != null) &amp;&amp; (tabForms.SelectedTab.Tag != null)) (tabForms.SelectedTab.Tag as Form).Select(); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload