Windows窗体通知图标无法正常工作

时间:2019-05-18 09:12:27

标签: c#

通知图标在2或3秒钟后消失,我必须重新启动应用程序

我已经尝试过此代码,但无法正常工作

 
    private void Frm_Dashboard_Resize_1(object sender, EventArgs e)
        {
            if (this.WindowState == FormWindowState.Minimized)
            {
                Hide();
                notifyIcon1.Visible = true;
            }
        }

private void notifyIcon_MouseDoubleClick(object sender, MouseEventArgs e) {

ShowInTaskbar = true; notifyIcon1.Visible = false; WindowState = FormWindowState.Normal; }

1 个答案:

答案 0 :(得分:0)

您不是NotifyIcon双击事件中的showing表单。

将代码更改为-

private void notifyIcon_MouseDoubleClick(object sender, MouseEventArgs e)
        {

        Show(); //display the form
        this.WindowState = FormWindowState.Normal;
        notifyIcon1.Visible = false;
    }

此外,请查看ShowBalloonTip方法的备注部分