some labels appear gray in Visual Studio 2010

783 views Asked by At

I was looking for a fix in the past two days about this problem, although without any success, so maybe someone knows how to solve this. Some labels in my application appear gray. What I did:

  1. I compared the properties of a label that appears gray with the properties a label that doesn't appear gray in the application. The only difference was the displayed text, so their properties were identical.
  2. I deleted the gray label and created a new one with the same text and placed it on the same place in the form. The "new" label was shown gray again. (see image here) I get this in other forms in my application as well. Any clue how to solve this?

Here are the code sequences from the Designer file:

this.label16 = new System.Windows.Forms.Label();
this.tabPage2.Controls.Add(this.label16);
resources.ApplyResources(this.label16, "label16"); this.label16.Name = "label16";
private System.Windows.Forms.Label label16;

Many thanks in advance.

Boris

1

There are 1 answers

1
Daniel Hilgarth On

A possible reason for this behavior is that you placed the label inside another container - like a panel or tab control - which was disabled.

A disabled container control automatically disables all its children.