c#新手 请教。Winform 中 notifyIcon 的问题

Kogeo_Guan Kogeo_Guan 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
在窗体 myorder 中 有

private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e)
{
if (this.WindowState == FormWindowState.Minimized)
{
this.ShowInTaskbar = true; //显示在系统任务栏
this.WindowState = FormWindowState.Normal; //还原窗体
notifyIcon1.Visible = false; //托盘图标隐藏
}
}
private void Myorder_SizeChanged(object sender, EventArgs e)
{
if (this.WindowState == FormWindowState.Minimized) //判断是否最小化
{
this.ShowInTaskbar = false; //不显示在系统任务栏
notifyIcon1.Visible = true; //托盘图标可见
}
}

在myorder 中 menu 可以打开 其他窗体 print

private void printToolStripMenuItem_Click(object sender, EventArgs e)
{
Printer printr = new Printer();
printr.Owner = this;
printr.ShowDialog();
this.Hide();
}


但是问题出来了.. 当我关闭 print 窗体时.. 居然 启动了 notifyIcon 窗体缩去右下角的任务栏那里去了。
而且点击 他也不会 弹回来. 也不报错误!

请问是什么问题呢? 谢谢...
...全文
评论 7
收藏 已收藏
分享
返回顶部
Kogeo_Guan
C# 111,130 成员 642,539 内容