ShowInTaskbar problems at run time


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
 
Ad

Advertisements

L

Lee Alexander

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

Regards
Lee Alexander
 
Ad

Advertisements

P

Paul Roberts

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top