Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - How does C# judge whether messagebox exists?
How does C# judge whether messagebox exists?
I made it for you in 2005! There are only two buttons in the interface! Add the following codes for the click events of the two buttons respectively:

Use the system;

Use the system. Assemble. Generics;

Use the system. Component model;

Use the system. Data;

Use the system. Drawing;

Use the system. Text;

Use the system. Windows . Forms

Namespace WindowsApplication 1

{

Public partial classes Form 1: Form

{

The public string isNull = null// defines a global variable.

Public Form 1 ()

{

initialize component();

}

Private void button 1_Click (object sender, EventArgs e)

{

is null = convert . tostring(messagebox . show(" alarm 1 "," prompt 1 ")。 ToString());

}

Private void button2_Click (object sender, EventArgs e)

{

if (isNull == null)

{

MessageBox。 Display ("Alarm 2" and "Prompt 2");

}

other

{

MessageBox。 Show ("There is already a dialog box!" );

}

}

}

}