J
Joe Cool
I am working on a tray applicaiton where I use the main form as a
configuration form. When the app starts up, I hide the main form by
setting its WindowState property to Minimized and ShowInTaskbar
property to False.
One of the notify icon's context menu item is to show the
configuration form, and in that menu item's Click event handler I set
the WindowState property to FormWindowState.Normal and ShowInTaskbar
property to true. Later, when the form's Close button ( custom Button
control, the ControlBox is set to False) is clicked, I re-hide the
form by setting ShowInTaskbar to false and WindowState to
FormWindowState.Minimized.
This works fine. MOST of the time. But occasionally, for no apparent
reason, when I click on the form's close button, the form does not
completly hide itself. An icon resembling a taskbar icon is visible
just above the Windows Start button. Once it has appeared like that,
every time I then reopen and close, this icon is still visible. But if
I shut down the app and restart, it starts working as expected MOST of
the time.
Any ideas why this is happening and how I can prevent it?
Or is this just a but in .NET?
configuration form. When the app starts up, I hide the main form by
setting its WindowState property to Minimized and ShowInTaskbar
property to False.
One of the notify icon's context menu item is to show the
configuration form, and in that menu item's Click event handler I set
the WindowState property to FormWindowState.Normal and ShowInTaskbar
property to true. Later, when the form's Close button ( custom Button
control, the ControlBox is set to False) is clicked, I re-hide the
form by setting ShowInTaskbar to false and WindowState to
FormWindowState.Minimized.
This works fine. MOST of the time. But occasionally, for no apparent
reason, when I click on the form's close button, the form does not
completly hide itself. An icon resembling a taskbar icon is visible
just above the Windows Start button. Once it has appeared like that,
every time I then reopen and close, this icon is still visible. But if
I shut down the app and restart, it starts working as expected MOST of
the time.
Any ideas why this is happening and how I can prevent it?
Or is this just a but in .NET?