I have a windows form application written in C# and it has three tabs and I would like the accept button change with the active tab. Like When I am in tab 1 I want button _
TabControl have SelectedIndexChanged event.
private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
{
if (tabControl1.SelectedTab == tabControl1.TabPages["RenewalTab"])
{
this.AcceptButton = btnRenewal;
}
else if (tabControl1.SelectedTab == tabControl1.TabPages["SellerTab"])
{
this.AcceptButton = btnSeller;
}
}