怎么样在点了窗体的关闭按钮后,是程序缩小到系统托盘显示~~
要用系统API吗?
求高人指点,小弟先谢过~~
要用系统API吗?
求高人指点,小弟先谢过~~
解决方案 »
- checkbox的反应慢的问题
- sqlhelper 使用事务实例的2个疑问?
- 我有一个是用SQLite .net建的数据库如何打开???在线等
- SQL存储过程中加多个参数出现错误提示:参数过多?我有8个输入参数和一个输出参数?如何解决?
- visual studio 2005中自动生成
- 枚举里能是数字吗?
- 算法求救
- 求解:ValueChanged事件死循环问题
- 求Sparx Systems的Enterprise Architect(EA)专业版V.3.51
- inno setup打包时给xml文件修改的权限
- 在没有网页的情况下,调用一个类上传一个文件,请问高手怎么做
- 这段代码打印少行,请大家帮我看一下为什么?
http://www.syncfusion.com/faq/windowsforms/search/568.aspx你需要在Form_Closing事件中做处理
e.Cancel = true;
showintaskbar = false;
添加NotifyIcon 控件。
this.Closing += new System.ComponentModel.CancelEventHandler(this.Form1_Closing);添加方法
private void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
//设置notifyIcon1属性,Icon必须有;
}
private void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
//ICON属性在属性栏选择
Form1 form1 = new Form1 ();
form1.Hide ();
this.ShowInTaskbar =false;
}
以上代码的运行结果是:运行时图标区会有增加一个小图标,但是关闭程序后小图标也会接着消失。
------------------------我是新手--------------------
{ this.WindowState = FormWindowState.Minimized;
e.Cancel = true;
}
{
this.Hide ();
this.ShowInTaskbar =false;
DialogResult dr = MessageBox.Show("fds","fsf",MessageBoxButtons.OKCancel,MessageBoxIcon.Question);
if(dr==DialogResult.Cancel)
{
e.Cancel = true;
}
}
{
this.Hide ();
e.Cancel = true;
}
{
this.WindowState = System.Windows.Forms.FormWindowState.Minimized;
e.Cancel=true;
}