0
点赞
收藏
分享

微信扫一扫

【Vegas改编】Winform最小化,系统托盘出现图标,并气泡显示tip

环境: C# C/S

DEMO:

​​

【Vegas改编】Winform最小化,系统托盘出现图标,并气泡显示tip_托盘图标

​​

做法:

1,在Winform中拖进notifyIcon控件;

2,更改icon图标、Text内容;

3,在Click事件中添加:

private void notifyIcon1_Click(object

{

if (this.Visible == false)

{

this.Visible = true;

this.WindowState = FormWindowState.Normal;

this.notifyIcon1.Visible = false;

}

}

 

4,在Form窗口添加Resize事件:

private void frmServerWatch_Resize(object

{

if (this.WindowState == FormWindowState.Minimized)

{

this.Visible = false;

this.notifyIcon1.Visible = true;

"PACS OS Monitor";

"程序最小化,仍继续运行......" + "\r\n" + "单击托盘图标还原窗口.";

//消失时间

}

}

5,Try!

举报

相关推荐

0 条评论