TO: whom in may concern:
I'm working with messagebox.show's, and I'm trying to call one, and then another one. I get the first one, but not the second one. Could provide some insights please. I;ve included my C# source to show what I have done.
Thanks in advance.
Aug 8, 2022
RSVP Please.
========================
if (ifileQfound != 1) /// if file is not found.
{
Console.WriteLine(" We're in");
d = MessageBox.Show(this," DLL File_Error-FNF: Required 'datelibrary.Dll' file is not found. Exiting Out??...",
"DateWare Demo App", MessageBoxButtons.OK,MessageBoxIcon.Exclamation);
Console.WriteLine(d);
if (d == DialogResult.OK)
{
this.Close();
Console.WriteLine("----");
d1 = MessageBox.Show(this, " DLL File_not_found. Do you want to fix the problem?. ",
"DateWare Demo App", MessageBoxButtons.YesNo, MessageBoxIcon.Question,
MessageBoxDefaultButton.Button2);
Console.WriteLine(d1);
if (d1 == DialogResult.Yes)
{
this.Close();
fixit = true;
}
else
{
Console.WriteLine("We don't want to fix it!. ");
fixit = false;
}
}
if(fixit)
{
Console.WriteLine("We want to fix it!. ");
}
Console.WriteLine(" We're Leaving..." + fixit.ToString());
Application.Exit();
}
Amit MohantyPosted Aug 9, 2022, 4:54 AM
Thad T.Posted Aug 9, 2022, 4:42 PM
Vishal JoshiPosted Aug 9, 2022, 7:00 AM
Amit MohantyPosted Aug 9, 2022, 4:50 AM
Sam HobbsPosted Aug 9, 2022, 3:35 AM
Are you sure that DialogResult.OK is the same as MessageBoxResult.OK?
One way to diagnose problems like that is to use the debugger to single-step through the code. When you do, and if the preceding indicates the problem, then you would have known to look closer at the if condition.