I have a tab control and 3 tabs. (WITH#)
if I am on tab 2 and edit the value of the text field and then click the tab 3, I need to check what was entered in the text field. if it’s right, I have to let me switch to tab 3, the rest should stay on tab 2 how can I achieve this?
iam, processing the leave event on tab2, i check the value of the text field there, and if it is found invalid i is set as tabcontrol.Selectedtab = tabpage2; check does it, but switch to a new tab! how can i limit navigation.
I'm new to C #, so maybe I'm dealing with the wrong event!
Here is the relevant code:
private void tabpage2_Leave(object sender, EventArgs e)
{
if (Validatetabpage2() == -1)
{
this.tabcontrol.SelectedTab =this.tabpage2;
}
}