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
Sorry about that. In that case, it looks like you may only be able to do this if you have unmanaged code rights. You can override the WndProc in your mdi parent Form. If the message coming in it WM_CLOSE (0x0010), the Form is about to close and you can set your flag.
that is not possible because validating fires before formclosing.
Stefan
You might be able to set a flag in the FormClosing of the parent and bypass your validating code when the flag is set.
we are having the same problem and Bills answers works fine how can I prevent the validation when the user closes the Parent form?
regards
perfect, I was not aware of that method.