Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to use EXIT button without interference from LEAVE e
Message
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 1.1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Miscellaneous
Thread ID:
01053590
Message ID:
01053671
Views:
9
>I commented out the code in the Leave Event and put the code into the Validation Event. Should I have wiped out even the commented code?<

No, sorry, I didn't notice that it was commented out. It's fine.

>How do you set CausesValidation to false when it won't accept it?<

What do you mean it won't accept it? You should be able to set the Form's .CausesValidation property to false in the Property Sheet. Are you using a Form sub-class that's not allowing it for some reason?

~~Bonnie





>Yes, I use a button to exit.
>
>How do you set CausesValidation to false when it won't accept it?
>
>I commented out the code in the Leave Event and put the code into the Validation Event. Should I have wiped out even the commented code?
>
>Cecil
>
>>How are you exiting the application? By clicking on a Button? If so, Chris's suggestion should work. By setting that button's .CausesValidation property to false, and having the button's .Click event handler execute the Application.Exit() method, the only event on the text box that should fire *is* the Leave event. If you have moved your code out of the Leave and into the Validating or the Validated event, it will not fire.
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform