public void updateTab(ClientDB client) { if (openedTabs.ContainsKey(client.idClient)) { MyTabPage tabPage = openedTabs[client.idClient]; tabPage.Text = client.raisonSocial; } }
/// <summary> /// Add a client to the TabControl, check whether the form display Client isn't already opened /// </summary> /// <param name="client">Used to link the tab with the client</param> public void addTab(frmDspClient fdc) { MyTabPage tabPage = new MyTabPage(fdc); //Add the tab to the tab control this.Controls.Add(tabPage); //Set the actual display this.SelectTab(tabPage); openedTabs.Add(fdc.Client.idClient, tabPage); }
/// <summary> /// Remove the tab from the tabControl /// <para>Check whether the tab is already opened</para> /// </summary> public void removeTab(ClientDB client) { if (openedTabs.ContainsKey(client.idClient)) { MyTabPage tabPage = (MyTabPage)openedTabs[client.idClient]; if (tabPage != null) { this.TabPages.Remove(tabPage); openedTabs.Remove(client.idClient); } } }
public Boolean displayTab(ClientDB client) { Boolean tabExist = false; if (openedTabs.ContainsKey(client.idClient)) { MyTabPage tabPage = (MyTabPage)openedTabs[client.idClient]; this.SelectTab(tabPage); tabExist = true; } else { tabExist = false; } return(tabExist); }