为了让自己设计的软件更高逼格一点,那就加入托盘吧!
详细步骤请看下文~
步骤一:从工具箱中添加控件——NotifyIcon,到窗体上;
步骤二:设置NotifyIcon属性
(1)Visible设置成false
(2)Icon添加托盘图像
步骤三:代码
//窗体最小化时托盘出现;窗体其它状态时,托盘不出现
private void FormModifyPwd_Resize(object sender, EventArgs e)
{
if (this.WindowState == FormWindowState.Minimized)
{
notifyIcon1.Visible = true;
}
else
{
notifyIcon1.Visible = false;
}
}