private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
{
DialogResult dr = MessageBox.Show("确定要关闭么?否则将现实在托盘!", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (dr == DialogResult.Yes)
{
//dosomething
this.Dispose();
}
else
{
this.Hide();
this.ShowInTaskbar = false;
e.Cancel = true;
}
}
private void MainForm_MinimumSizeChanged(object sender, EventArgs e)
{
this.Hide();
this.ShowInTaskbar = false;
}
private void icoShow_DoubleClick(object sender, EventArgs e)
{
this.Visible = true;//设置正常显示控件的值
this.WindowState = System.Windows.Forms.FormWindowState.Normal;//指定窗口窗体正常显示
this.icoShow.Visible = true;
}
#region 方法:显示错误提示供回调void OnShowMessage
/// <summary>
/// 显示错误提示供回调
/// </summary>
///<param name="no param"></param>
/// <returns>void</returns>
private void OnShowMessage(string strMessage)
{
icoShow.ShowBalloonTip(200000, "注意:", strMessage, ToolTipIcon.Error);
}
#endregion
浙公网安备 33010602011771号