vbud
Dec 7th, 2006, 11:23 PM
Hi all, i have the following situation on a Windows Mobile 5 device :
I have some validation on the lost focus event of a control. However when the user clicks on the Cancel button, the lost focus event of the above control is triggered before the click event, which is normal i guess, but validation error messages are displayed while the form is closing. Is there a way in the lost focus event or any other work around to determine if the Cancel button was clicked or something so that I can suppress validation messages then? I was checking if the Cancel button had focus to do this but I think its not a very elegant solution. Please note that i'm using C#.
I have some validation on the lost focus event of a control. However when the user clicks on the Cancel button, the lost focus event of the above control is triggered before the click event, which is normal i guess, but validation error messages are displayed while the form is closing. Is there a way in the lost focus event or any other work around to determine if the Cancel button was clicked or something so that I can suppress validation messages then? I was checking if the Cancel button had focus to do this but I think its not a very elegant solution. Please note that i'm using C#.