-3

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

B4IcU
  • 11
  • 3
  • post the labels code from your Form.Designer.cs – h3n Jun 08 '15 at 06:05
  • You can upload and host image on Google Drive or Dropbox and get a link here? Also you can post code from `form.designer.cs` file... – Alexey Nis Jun 08 '15 at 06:05
  • Welcome to SO! Please, look at this page and edit your question: http://stackoverflow.com/help/mcve – Dennis Jun 08 '15 at 06:05
  • @Alexey Nis: Thank you for your tip: I have already uploaded an image on Google Drive and here is the [link](https://drive.google.com/file/d/0B0sjlBJTJtukcUtPMkdScjdJWFk/view?usp=sharing) – B4IcU Jun 08 '15 at 09:48
  • @Boris, please search for part where label16 was created. Usually it's closed with `#region` – Alexey Nis Jun 08 '15 at 10:04
  • @Boris, I guess, your problem in resource file... I don't see any problems in code... – Alexey Nis Jun 08 '15 at 10:51

1 Answers1

0

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.

Daniel Hilgarth
  • 171,043
  • 40
  • 335
  • 443
  • @ Daniel Hilgarth: Thank you for your answer. Unfortunately, this can not be the reason. I have other labels in the tab page or in the group box respectively and all of them appear as they should – B4IcU Jun 08 '15 at 09:46