Click here to Skip to main content
15,929,218 members
Home / Discussions / C#
   

C#

 
GeneralRe: Control Box Close Button Event Pin
Martin#23-Jul-07 2:41
Martin#23-Jul-07 2:41 
GeneralRe: Control Box Close Button Event Pin
Luc Pattyn23-Jul-07 3:07
sitebuilderLuc Pattyn23-Jul-07 3:07 
GeneralRe: Control Box Close Button Event Pin
Martin#23-Jul-07 3:09
Martin#23-Jul-07 3:09 
GeneralRe: Control Box Close Button Event Pin
Luc Pattyn23-Jul-07 3:30
sitebuilderLuc Pattyn23-Jul-07 3:30 
GeneralRe: Control Box Close Button Event Pin
Martin#23-Jul-07 3:43
Martin#23-Jul-07 3:43 
GeneralRe: Control Box Close Button Event Pin
Luc Pattyn23-Jul-07 4:02
sitebuilderLuc Pattyn23-Jul-07 4:02 
GeneralRe: Control Box Close Button Event Pin
Martin#23-Jul-07 4:13
Martin#23-Jul-07 4:13 
GeneralRe: Control Box Close Button Event Pin
Luc Pattyn23-Jul-07 4:13
sitebuilderLuc Pattyn23-Jul-07 4:13 
Furthermore, MSDN on Form.DialogResult says:
"clicking the Close button (the button with an X in the top-right corner of the form) causes the form to be hidden and the DialogResult property to be set to DialogResult.Cancel."

It does not say explicitly WHEN it does that, so I guess it is in base.OnClosing (e);

It does say "You can override the value assigned to the DialogResult property when the user clicks the Close button by setting the DialogResult property in an event handler for the Closing event of the form"

So I guess the base.OnClosing() does something like
if (DialogResult==None) DialogResult=Cancel

and hence your tip does not work, whereas setting it to something else
such as DialogResult=Yes; would work

(but it would then violate the GUI conventions, as I keep telling you).

Smile | :)


GeneralRe: Control Box Close Button Event Pin
Martin#23-Jul-07 4:20
Martin#23-Jul-07 4:20 
GeneralRe: Control Box Close Button Event Pin
Luc Pattyn23-Jul-07 4:41
sitebuilderLuc Pattyn23-Jul-07 4:41 
GeneralRe: Control Box Close Button Event Pin
Martin#23-Jul-07 4:45
Martin#23-Jul-07 4:45 
GeneralRe: Control Box Close Button Event Pin
Luc Pattyn23-Jul-07 4:59
sitebuilderLuc Pattyn23-Jul-07 4:59 
QuestionFile Download Pin
AB777122-Jul-07 20:33
AB777122-Jul-07 20:33 
AnswerRe: File Download Pin
Christian Graus22-Jul-07 20:54
protectorChristian Graus22-Jul-07 20:54 
GeneralRe: File Download Pin
AB777122-Jul-07 20:59
AB777122-Jul-07 20:59 
Questionglossary Pin
vimala soujanya22-Jul-07 20:29
vimala soujanya22-Jul-07 20:29 
AnswerRe: glossary Pin
Christian Graus22-Jul-07 20:52
protectorChristian Graus22-Jul-07 20:52 
Questiondropdown list problem Pin
srinivassam22-Jul-07 20:26
srinivassam22-Jul-07 20:26 
AnswerRe: dropdown list problem Pin
Christian Graus22-Jul-07 20:37
protectorChristian Graus22-Jul-07 20:37 
QuestionHow to disable right click menu/ context menu of datagrid Pin
Software_Guy_12322-Jul-07 20:03
Software_Guy_12322-Jul-07 20:03 
AnswerRe: How to disable right click menu/ context menu of datagrid Pin
Martin#22-Jul-07 20:16
Martin#22-Jul-07 20:16 
GeneralRe: How to disable right click menu/ context menu of datagrid Pin
Software_Guy_12322-Jul-07 20:45
Software_Guy_12322-Jul-07 20:45 
AnswerRe: How to disable right click menu/ context menu of datagrid Pin
Software_Guy_12330-Jul-07 19:54
Software_Guy_12330-Jul-07 19:54 
QuestionMutlithreading:-Playing Mutiple Video files CPU 100% Pin
leoiser22-Jul-07 19:51
leoiser22-Jul-07 19:51 
AnswerRe: Mutlithreading:-Playing Mutiple Video files CPU 100% Pin
Luc Pattyn23-Jul-07 2:25
sitebuilderLuc Pattyn23-Jul-07 2:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.