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
David
NA
1
0
MDI and CHILDS form problem
May 8 2007 7:13 PM
Hi,
My English is not native, sorry.
I have MDI form and Child form.
I added "Form_Closing" event to the MDI code file. the following is the code:
private void frmMainMdi_FormClosing(object sender, FormClosingEventArgs e)
{
// Hold the MessageBox button pressed
DialogResult diaResult;
// Show Message to the User
diaResult = MessageBox.Show("Are you sure you want to cancel the setup?",
"Exit Setup",
MessageBoxButtons.YesNo,
MessageBoxIcon.Warning,
MessageBoxDefaultButton.Button2);
// Checking which button as been pressed
if (diaResult == DialogResult.No)
{
// CANCEL pressed, set focus to the program
e.Cancel = true;
}
else
{
// YES pressed, exit the program
this.Dispose();
Application.Exit();
}
}
Now, in the child form i have CANCEL button that suppose to teminate the application if the user press YES.
I added to the click event the following code:
private void btnCancel_Click(object sender, EventArgs e)
{
Application.Exit();
}
And now I am having the problem.
I am getting an error when I try to cancel the program and the error points to the cancel button, application.exit();
How can I terminate the program from runnning when pressing the cancel button?
Thanks
VBDC
Reply
Answers (
0
)
Multiple File IO, Random Access.
void write (object obj);