TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
jakar
NA
1
0
Minimize on close, but only from X
Sep 11 2004 6:12 PM
Hi, I want to prevent my main Form from closing when the X in the upper right is pressed. I am handling the Closing event, and can change the CancelEventArgs.Cancel to true. The problem is I don't want to prevent the user from closing the Form using the Exit option in the menu. The Exit menu just calls this.Close() at the moment. Should the Exit menu call something else? Or is there a way to differenciate who initiated the call? During either operation, the "sender" to the Closing event is the Form. I guess I could just set a bool value on the Form that tells me not to exit the application, then set the value to say exit the application during the menu Exit, just before calling this.Close(). Is there a cleaner way of doing this?
Reply
Answers (
1
)
Datagrid
Winforms Transparency problem!!!