Main form not shown in Taskbar
Asked Answered
B

5

6

What could be the reasons for the Main application form not to be shown in TaskBar?

ShowInTaskbar property is set to "true", but form doesn't show itself there if after running the application and before the Main form appears I switch to some other window. Form exists, but until I minimize apps that are above to make it visible, it won't show in Taskbar.

UPDATE. Form does not have an Owner.

Benefice answered 15/11, 2010 at 11:19 Comment(4)
What's the form's border style?Ishmaelite
What happens between starting the application and showing the main form? Is there a splash screen or some kind of log-in form being shown that could be getting in the way?Palaeontography
@Cody Gray: Log-in form is shown, and after that the form to select a file that will be shown in the Main form.Benefice
Make sure that you're not showing the main form as a child or owned dialog of the log-in form.Palaeontography
B
8

I've added form.Activate() after form.Show(). Now it always jumps out when completely loaded, and doesn't get lost under some other screens.

Though it is not a solution, but a crutch, responses are welcome anyway.

Benefice answered 22/11, 2010 at 11:30 Comment(1)
that does the trick and I prefer that to my method which was to set the form's topmost property to true and then false in the Shown event. I inherit from base forms also which helps.Nairobi
V
0

Check if your main form has a Parent defined or an Owner. In either case that would exclude it from being in the task bar in its own right. Also worth trying TopMost=true.

Vivien answered 15/11, 2010 at 11:24 Comment(0)
I
0

I had the same issue with one project I wrote. No icon showing in the Taskbar unless I forced Windows to refresh it.

It was a call to

this.MinimumSize = new Size(wid, len);

In the Form_Load that was the issue.

Intransigence answered 23/3, 2013 at 1:23 Comment(0)
H
0

I had a similar issue when the program was run from an installer (InstallMate in my case). I eventually pinned the problem down to changing the form's title text (Text) in the Form1_Load() method. When I moved that title changing text to just below the InitializeComponent(); bit, the problem went away.

I hope this can help someone else, despite the specificness of my circumstances.

Heuer answered 9/1, 2014 at 5:11 Comment(0)
E
0

I had the same issue as @deegee where setting MinimumSize in the Form Load causing the non display in the Taskbar. I fixed the issue with setting the Form Visible to False then to True.

Emelda answered 9/3, 2022 at 16:6 Comment(3)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Lelalelah
This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. To get notified when this question gets new answers, you can follow this question. Once you have enough reputation, you can also add a bounty to draw more attention to this question. - From ReviewMudfish
The Question title was "Main form not shown in Taskbar" which was why I came here, and the answer is that is can be caused and fixed as describedEmelda

© 2022 - 2024 — McMap. All rights reserved.