ShowInTaskbar problems at run time

  • Thread starter Thread starter Claire
  • Start date Start date
C

Claire

Ive an application that usually runs in the taskbar. ShowInTaskbar is set to
false during InitializeComponent.
It works fine.
However, I decided that i'd like the application to show in the task bar
when it was open on the desktop so set ShowInTaskbar to true when the form
was unhidden.
Unfortunately the application fell over with an "unable to get window
handle" error.
Am I able to set this property after initialization?

thanks
Claire
 
Perhaps you could post some example code showing this problem...

Regards
Lee Alexander
 
Hi Clair,

What I have done and it seems to work so far is put the following code in
the constructor of the form. I think I went down the path trying to hide
the form too but ran into problems.

this.ShowInTaskbar = false;
this.WindowState = FormWindowState.Minimized;

When I want to reshow the form I basicaly do the opposite.

this.WindowState = FormWindowState.Normal;
this.ShowInTaskbar = true;

Hope this helps
Paul
 
Back
Top