A problem with application icon taskbar.

E

Elad Gutman

Hi Everyone,

I'm facing an annoying problem and any help will be most appreciated .
.. .

I have a main application form and its icon is functioning excellent:
it appears both in the taskbar and whenever you switch using the Alt +
Tab keys.
At a certain point of the code I'm creating a new form, using a
different thread for this task in order to prevent 'blinking' until
the new form is created and displayed. The code looks like that:

newFormThread = new Thread(new ThreadStart(CreateNewForm));
newFormThread.Start();

The function 'CreateNewForm' looks as following:

newForm = new NewForm();
// Several 'NewForm' initializations . . .
Application.Run(newForm);

In the 'Load' function of 'NewForm' I also have the following line:

MainApplicationForm.Visible = false;

(So the main application form is hidden and only the new form is
displayed.)

Once I'm done with the new form I'm setting the 'Visible' property of
the main application form to 'true' and it's being displayed again.

Everything is working just fine. However, once the NewForm is
displayed its icon doesn't appear in the task bar. I do have an icon
once I'm using the Alt + Tab keys but this is the main application
icon (I gave the NewForm a different icon in order to try and
isolating the problem).

Can anyone help here?

Many thanks,


Elad
 
G

Guest

Hi,

Are you sure that additional thread with "Application.Run(...)"
is really needed for your application?
I think that simple "newForm.Show()" (eventually from newFormThread
thread) should do the job.

To see newForm in "Alt+Tab" list assure that its "ShowInTaskbar"
property is set to "true".

Regards

Marcin
 
E

Elad Gutman

Marcin Grz?bski said:
Hi,

Are you sure that additional thread with "Application.Run(...)"
is really needed for your application?
I think that simple "newForm.Show()" (eventually from newFormThread
thread) should do the job.

To see newForm in "Alt+Tab" list assure that its "ShowInTaskbar"
property is set to "true".

Regards

Marcin

Hi Marcin,

Thanks for your quick answer . . .

I understand I should use a different thread but instead of
'Application.Run' I should use the 'newForm.Show' method. Am I
correct?

Well, I tried doing that but for some reason the NewForw is not
displayed at all! I tried using the 'newForm.ShowDialog' and got the
same results - NewForm is displayed but no icon in the taskbar.

Any other thoughts?

Thanks,


Elad
 

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