private void tabControl1_SelectedIndexChanged(object sender, EventArgs e) { if (tabControl1.SelectedIndex.Equals(0)) { Transfer2 transfer2 = new Transfer2("For Transactions"); transfer2.Text = this.Text; showForm(panelTransactions, transfer2); } else if (tabControl1.SelectedIndex.Equals(1)) { Transfer2 transfer2 = new Transfer2("For SAP"); transfer2.Text = this.Text; showForm(panelSAP, transfer2); } }
private void Transfer_Load(object sender, EventArgs e) { foreach (TabPage tp in tabControl1.TabPages) { if (tp.Name.Equals("tabPage1")) { if (this.Text == "Pullout Transactions") { tp.Text = "For Confirmation"; } else { tp.Text = "Transactions"; } } if (tp.Name.Equals("tabPage2")) { if (this.Text == "Received Transactions") { tp.Text = "For SAP"; } else if (this.Text == "Pullout Transactions") { tp.Text = "For SAP IT and Transfer"; } else { tp.Text = "Logs"; } } } Transfer2 transfer2 = new Transfer2("For Transactions"); transfer2.Text = this.Text; showForm(panelTransactions, transfer2); }