Tabcontrol validating


28-Nov-2019 20:24

Is there a way to prevent the user from leaving a tab on a Tab Control until all the controls on that tab have finished validating? Another approach would be to somehow cancel the pending validating event when the user selects another tab page. I can setup a tab page leave event, but to what benefit? According to MSDN events happen in following order: Focus events occur in the following order: 1.. I would allow user to fill pages in the order he/she prefers and jump between them at will. Being able to do that might help for my particular circumstances. For certain control, once it has focus, it will validate its data for closing, leaving, etc.. So the only problem when changing pages is when all the child controls on the form have no focus, then swith pages will not trigger the child controls' validating events.

The problem I am experiencing is when a control fails its validating event and the user clicks another tab things get messy. Thanks Dennis "Alex S" Hi, Dennis did you try to hook Tab Page. Otherwise it is better to use Wizard-style approach, when consecutive screens are shown each after another and errors on screen N do not allow to go to screen N 1. Another approach would be to somehow cancel the pending validating event when the user selects another tab page. I can setup a tab page leave event, but to what benefit? According to MSDN events happen in following order: Focus events occur in the following order: 1.. For this issue, I think there are 2 workarounds: 1.

Do you want to know when a feature you care about is added or when a bug fixed?

If I have not understand your solution update me the last code which i have sent you in earlier response. If the selected tab is the first tab, you need to validate according to the text box that is in the second one and reverse. Thanks, Ajay Hi Ajay, You should check witch tab is clicked and validate according to that.- This posting is provided "as is" with no warranties and confers no rights.

Hi Dennis, Based on my understanding, you want to validating all the controls on the tabpage before switch pages.

For this issue, I think there are 2 workarounds: 1.