form close
-
hello can someone tell me whats wrong with my codes..
if (DialogResult.Yes == MessageBox.Show("Exit?","Message",MessageBoxButtons.YesNo,MessageboxIcon.Question))
{
Close();
}if i put it in a button it works fine.. But if i put it in formClose or formClosing Event when i clicked the yes button the messagebox just stay in the center of the form and it wont close but if i click no the form exits. ginji
-
hello can someone tell me whats wrong with my codes..
if (DialogResult.Yes == MessageBox.Show("Exit?","Message",MessageBoxButtons.YesNo,MessageboxIcon.Question))
{
Close();
}if i put it in a button it works fine.. But if i put it in formClose or formClosing Event when i clicked the yes button the messagebox just stay in the center of the form and it wont close but if i click no the form exits. ginji
this may help
if (DialogResult.Yes != MessageBox.Show("Exit?","Message",MessageBoxButtons.YesNo,MessageboxIcon.Question))
{
e.Cancel = true;
}I Wish the Life Had CTRL-Z www.subaitech.blogspot.com
-
this may help
if (DialogResult.Yes != MessageBox.Show("Exit?","Message",MessageBoxButtons.YesNo,MessageboxIcon.Question))
{
e.Cancel = true;
}I Wish the Life Had CTRL-Z www.subaitech.blogspot.com
-
there was no
e.Cancel = true
when i press e. the only available is Closereason,Equals,Gethashcode,Gettype and ToString
You can only cancel the formClosing event. The FormClose event means there's no stopping it. I guess you're handling the latter.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
there was no
e.Cancel = true
when i press e. the only available is Closereason,Equals,Gethashcode,Gettype and ToString
When Form_Closed occurred the Form is Closed you may want try in Form_Closing
I Wish the Life Had CTRL-Z www.subaitech.blogspot.com
-
this may help
if (DialogResult.Yes != MessageBox.Show("Exit?","Message",MessageBoxButtons.YesNo,MessageboxIcon.Question))
{
e.Cancel = true;
}I Wish the Life Had CTRL-Z www.subaitech.blogspot.com
Gave you a 5. The trouble with the 'helpful answer/unhelpful answer' button, is morons who can't work out when they've been told a good answer.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )