开发者

Main form not shown in Taskbar

开发者 https://www.devze.com 2023-01-24 22:33 出处:网络
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 an

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 a开发者_开发百科re above to make it visible, it won't show in Taskbar.

UPDATE. Form does not have an Owner.


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.


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.


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.


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消