Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1483
Validating event occurs after the tab switch
posted

Hi,

  Is there any way to force the validating event to fire on a control prior to a tab switch so the tab switch can be cancelled?  This is how a normal tab control works. We seem to be receiving the validating event after the tab switch occurs which is nasty if validation fails and message box opens.  Also, if i open 2 tabs side by side using the grouping feature, I receive 2 validation events on the control losing focus when I select the other tab.  If validation fails then focus remains in the control with invalid data but the other tab is selected.  Is there anyway to get validation to work like a regular tab control, or turn validation off altogether?

 

Thanks,

Bill

Parents
  • 44743
    posted

    This actually looks like a bug with the .NET Form. If you remove the UltraTabbedMdiManager, you can enter invalid input on one mdi child, then select another mdi child and the other mdi child will be selected before the Validating event is fired. The UltraTabbedMdiManager just controls the layout of Forms in the mdi parent and does not get involved in activation. You can work around this by by calling Activate() on the mdi child before showing your message box in the Validating event. Also, you can turn off validation by setting CausesValidation on the mdi child Forms to False.

Reply Children