Can't change Label BackColor in designer (VS2005 Final)

Hello,

The environment
Visual Studio 2005 Final, Smart Device Application for Windows Mobile 2003, using .NET Compact Framework 2.0.

The problem
I have uninstalled VS2005 Beta 2 (using the automatic uninstall tool) and then installed VS2005 Final.

When I add a Label control to a blank form in the designer, I can't set the Label BackColor to a Web or Custom Color.

It seems that when the underlying Form has the System BackColor "Window", it affects the Label controls. If the underlying Form has a Web or Custom color - the BackColor of the Label can be changed - however the BackColor in the list of Properties for the Label, does not reflect the color that is shown in the designer.

I tried to change the color "manually" in the FormX.Designer.cs, that didn't work either.

I have the same problem on two different computers (followed exactly the same procedure) and the error appears on both machines. Both computers still have VS2003 installed.

Attempts to solve the problem
I have tried to run "devenv.exe /setup /resetuserdata", but that didn't solve the problem.
I have tried to create a new project to see if the problem would arise again - and it did.

Is there something I'm missing here - I have spent hours and hours now trying to find any posts on the net reporting the same problem but without any luck.

Others reporting the same issue
After writing this post, I came across another post in the forums, talking about the exact same issue and it is acknowledged as a definate bug, but there are no hints as to how to solve it:

http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=177411&SiteID=1&mode=1

Please help!
- Mikkel 



Answer this question

Can't change Label BackColor in designer (VS2005 Final)

  • bwechner

    Hi, I have verified with this is a known bug in VS 2005 RTM and is scheduled to be fixed. I have put in a note to consider this for SP1 of the release but at this time I can not say when that will be scheduled.

    Thanks

    Amit Chopra

     


  • REasley

    There are no firm dates. As soon as the division makes a call, i am sure you will see a blog or two about that in no time.

    And please feel free to send other feedback over to our team.

    Thanks

    Amit Chopra

     


  • Randy J

    If the workaround that Ilya suggested works for you then you should be unblocked by now. It is really not recommended to revert to Beta 2. If there are other similar bugs you are seeing please post them at this forum or you can even directly send them to me at achopra AT microsoft  DOT com.

     

    Thanks

    Amit


  • kef_c80

    Hello again,

    Unfortunately there is still no news from Microsoft regarding the release of Service Pack 1, but I have made a workaround for this problem that solves the problem with the labels in the Designer.

    I have implemented a very simple UserControl called MyLabel in the namespace System.Windows.Forms, that contains the most important features of the Label control (such as BackColor, ForeColor, TextAlign, Font etc.) - and it works fine in the Designer.

    I would like to share this with everybody, so please just follow this link to read more and for download.

    http://www.nsales.dk/download/


  • TGirgenti

    Hello Ilya,

    I know that this should work, but unfortunately it is not an option for me in this current project. My current project is rather large and consists of many forms containing many labels with a BackColor property different to the default one.

    What you are suggesting would mean that I would have to go through every form in my project, changing perfectly correct code just for the purpose of working around a simple bug in VS2005.

    This problem also means that when I open a form (that hasn't been opened since VS2005 Beta 2), every label is messed up, so I cannot open the largest forms in the designer since they will be messed up.

    I'm sorry if I sound a bit frustrated, and it is not my intention to sound arrogant in any way, but I didn't anticipate that the final release of VS2005 would cause this kind of problems. This problem is truly an obstacle in my organisation.

    Thank you for replying
    /Mikkel


  • Priyank001

    Hello Amit,

    It seems that you are right about the panel, but this is not the only workaround - almost any container-control will do for this job. I tried a TabControl, setting the TabPage BackColor to white - then the Label works as well.

    If this really is a bug in VS2005 (which I am getting pretty convinced that it is), then if MS should see this, I must say that I am very surprised that a bug like this can show up in a final version - I mean the first thing you usually would do with a Form in a Smart Device Application is to add a Label control and set its properties.

    Do you know how I can pursue the issue with regards to MS - eg. is there a hot-fix or service pack available This is a rather urgent problem, since every form in my solution is affected once they are opened in the designer.

    Thanks for testing it in your environment!

    Best regards
    Mikkel


  • Tranzistors

    Hi, First of all let me say, this is an extermely well written bug report. Makes it very clear for us to repro this in our environment.

    The interesting thing is that I am able to repro this on my personal machine which I don't think had an older version installed.

    Which make me believe this is not related to the un-install issue.

    I will run this by the NETCF Team to check if this is known issue in CF 2.0

    So now for the workaround, after playing around with this for a while I figured out that what you do is add a Panel. then Add the label to the Panel. set the BackColor of the Panel to White and then you will see that the label is now showing the correct back color.

    Let me know if this works in the meantime.

    Thanks

    Amit Chopra

     


  • MattMc3

    It's a designer issue, not runtime. That means you can workaround by setting this property value in form's constructor. For example:< xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

    public Form1()

    {

        InitializeComponent();

        this.label1.BackColor = Color.FromArgb(10, 20, 30); // Set label back color to some custom color.

    }



  • tgorrie

    Hello again,

    After some further testing, it seems that I will have to revert back to VS2005 Beta 2, since the final isn't final after all...  I must say, that I cannot recommend using VS2005 Final for Smart Device Applications at the time being.

    The workaround doesn't work when deploying to the device - the Label BackColor stays white on the device - even though its color is right in the designer. This is very, very bad - I can't open a singe Form any more - I fear that all labels will be messed up.

    This is not the only bug I have stumbled over - I will be back to describe the others.


  • TaDa

    Hello Amit,

    Now, that sounds promising!

    Thank you very much for your commitment to help solving this problem, I look forward to hearing more about the launch date for the SP1 - can you tell me where this will be announced

    I will email you one of these days with at least one more issue that I think might also be a bug in VS2005 designer (possibly already known).

    Thanks again, and a merry christmas and a happy new year to you all.
    /Mikkel


  • Jo Molnar - MSFT

    It is indeed unfortunate this bug slipped into release, but, while definitely annoying, it's rather minor issue with easy workaround, "simple bug" as you pointed out. Now, thanks to you, we're aware of it, we'll fix it as soon as possible. Meanwhile, all you have to do is to copy some code from one place to another, that's it.< xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

    You sure can move back to Beta 2 instead, but it would expire soon and you won't be able to use your application because I believe "go live" license is no longer available.

    If your project is large, just write a batch file to grab lines with ".BackColor =" for you, it would handle project of any size in a matter of seconds, you'll just need to insert lines into the right place. If you don't know how, let me know and I'll help you out with this.

     



  • AustinStephens

    Hi, I have sent mail to the NETCF Team get some clarifications on this and will let you as soon as I hear back from them.

    Thanks

    Amit Chopra

     


  • Can't change Label BackColor in designer (VS2005 Final)