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
260
How do I select an existing MDI tab without the tab duplicating?
posted

I am using the ultraTabbedMdiManager on an MDI form, checking to see if the form is already open and if open, attempting to select that tab programatically.  The problem is, it doesn't select the already existing tab/form, it creates another instance of that tab/form.  I've tried tab.Active(), tab.Show(), tab.Form.BringToFront and tab.Form.Select and all of these actually create another instance of the already existing tab.  Please see code snippet below.  Any assistance in solving this would be very much appreciated. 

Thanks, Michelle

 

 

 

foreach

 

 

 

(MdiTab tab in this

.ultraTabbedMdiManager1.ActiveTab.TabGroup.Tabs)

{

 

 

 

if (tab.Form.Name == "RequestForm")

{

 

 

 

if (((RequestForm)tab.Form).TransferRequest.ID == (int)this.QueueDataGridView.Rows[this.QueueDataGridView.SelectedRows[0].Index].Cells["RequestIDTextBoxColumn"].Value)

{

 

 

 

//Select tab

 

 

 

 

 

//tab.Activate();

 

 

 

tab.Form.Show();

//tab.Form.BringToFront();

 

 

//tab.Form.Select();

 

 

 

 

}

}

}

 

 

 

 

 

foreach

 

 

(MdiTab tab in this.ultraTabbedMdiManager1.ActiveTab.TabGroup.Tabs)

{

 

 

 

  if (tab.Form.Name == "RequestForm"

)

{

 

 

 

if (((RequestForm)tab.Form).TransferRequest.ID == (int)this.QueueDataGridView.Rows[this.QueueDataGridView.SelectedRows[0].Index].Cells["RequestIDTextBoxColumn"

].Value)

{

 

 

 

//Select tab

 

 

 

 

//tab.Activate();

 

 

 

 

//tab.Form.Show();

}

}

}

 

Parents
No Data
Reply Children
No Data