这个不用再messagebox代码里加,而是在主窗体里加,假如说你用主窗体的button来调用messagebox,那么代码为:
private void button1_Click(object sender, EventArgs e)
{
this.Hide();
if (MessageBox.Show("info", "test", MessageBoxButtons.OKCancel, MessageBoxIcon.Information) == DialogResult.OK)
{
this.Show();
}
}
if (MessageBox.Show("") = DialogResult.OK)
Form1.Show();
DialogResult dr = MessageBox.Show();
if (dr == DialogResult.OK)
{
this.WindowState = FormWindowState.Minimized;
}
Form1 form=new Form();
private void button_click(object sender, EventArgs e)
{
form.Show();
}