I'm having a problem. My application won't be shown in Windows 7 taskbar until it gets focus. I've tried a lot of things, including:
this.TopMost = true;
this.ShowInTaskBar = true;
In different stages of the form lifecycle, but nothing happens. The FormBorderStyle property is set to FixedSingle. The form only has a couple of buttons and a webbrowser (that gets an html page from the resources).
I'm running on Windows 7 64 bit.
Thanks.
-
1Your form has a property ShowInTaskbar, is it set in design-time? Maybe a little silly but; did you restart your computer and test it? Doesn't really seem like normal behavior if you didn't mess with that kind of things.. So maybe Windows is just in it's friday the 13th mood?Gerald Versluis– Gerald Versluis2012年07月13日 14:33:33 +00:00Commented Jul 13, 2012 at 14:33
-
1Is it only happening to the one app - or every app you create? Try creasting a new test winform app with a blank form and run it and see if that turns up.Wolf5370– Wolf53702012年07月13日 15:12:56 +00:00Commented Jul 13, 2012 at 15:12
-
1Post code that reproduces the problem.Hans Passant– Hans Passant2012年07月13日 15:24:13 +00:00Commented Jul 13, 2012 at 15:24
-
Hi, thank you, it happens only with this app both in debug time and when deployed via clickonce. I solved the problem by giving first focus to desktop and then to my app. Dirty solution but it works for now :) Oh, almost forgot, the application was downgraded from framework 4 to 2.Maximiliano Santa Cruz– Maximiliano Santa Cruz2012年07月13日 15:43:25 +00:00Commented Jul 13, 2012 at 15:43
2 Answers 2
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.
1 Comment
I just solved this problem. My experience is DO NOT change UI in the Load event, like:
void MyForm_Load(object sender, EventArgs e) {
this.Text = "xxx"; // DON'T do this in Load event.
}
Consider use Shown event.