Abdul Moiz
Abdul Moiz

Reputation: 33

windows form Notify Icon Not working properly

notify icon disappears after 2 or 3 seconds and i have to restart the application

I have tried this code but not working properly

 
    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; }

Upvotes: 0

Views: 218

Answers (1)

NoviceProgrammer
NoviceProgrammer

Reputation: 3365

You are not showing the form in the NotifyIcon double click event.

Change your code to -

private void notifyIcon_MouseDoubleClick(object sender, MouseEventArgs e)
        {

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

Also, look at the Remarks section of the ShowBalloonTip method

Upvotes: 1

Related Questions