3

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.

asked Jul 13, 2012 at 14:26
4
  • 1
    Your 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? Commented Jul 13, 2012 at 14:33
  • 1
    Is 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. Commented Jul 13, 2012 at 15:12
  • 1
    Post code that reproduces the problem. Commented 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. Commented Jul 13, 2012 at 15:43

2 Answers 2

1

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.

Madhawa Priyashantha
9,8757 gold badges39 silver badges66 bronze badges
answered Mar 23, 2013 at 0:03
Sign up to request clarification or add additional context in comments.

1 Comment

When you said 'icon' and 'taskbar' are you referring to the icons which launch an app, or the program windows you can switch between once the programs are already open?
0

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.

answered Jul 19, 2023 at 1:00

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.