7个回答
展开全部
首先拖一个控件notifyIcon1
要弹出的选择“关闭”或是“取消”的代码是
private void button1_Click(object sender, EventArgs e)
{
this.DialogResult = System.Windows.Forms.DialogResult.OK;
if (radioButton1.Checked == true)
{
this.Tag = 1;
}
else
{ this.Tag = 0; }
}
private void button2_Click(object sender, EventArgs e)
{
this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
}
弹出的窗口窗口的FormClosing时间的代码是
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
checkform msg = new checkform();
DialogResult rs = msg.ShowDialog();
if (rs == System.Windows.Forms.DialogResult.OK)
{
if (msg.Tag.ToString() == "1")
{
Application.ExitThread();
}
else
{
this.Hide();
e.Cancel = true;
}
}
else
{
e.Cancel = true;
}
}
要弹出的选择“关闭”或是“取消”的代码是
private void button1_Click(object sender, EventArgs e)
{
this.DialogResult = System.Windows.Forms.DialogResult.OK;
if (radioButton1.Checked == true)
{
this.Tag = 1;
}
else
{ this.Tag = 0; }
}
private void button2_Click(object sender, EventArgs e)
{
this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
}
弹出的窗口窗口的FormClosing时间的代码是
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
checkform msg = new checkform();
DialogResult rs = msg.ShowDialog();
if (rs == System.Windows.Forms.DialogResult.OK)
{
if (msg.Tag.ToString() == "1")
{
Application.ExitThread();
}
else
{
this.Hide();
e.Cancel = true;
}
}
else
{
e.Cancel = true;
}
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询