We help IT Professionals succeed at work.

Groupbox font versus label font when both have enabled set to false

I have a group box and a label.  I have both of their enabled properties set to false.  When you display the form, the font in the group box header looks different then the font in the label font.  Why is this?  This is a VB.NET 2005 winform application.  To reproduce this all you need to do is make a new project.  Place a label and a group box on the form.  Give the label some text in design mode and then set both enabled properties to false.  Put the label right above the group box text on the form.  Then run the app.  Notice the difference in the font color I guess is the best word I can come up with.  Why is this?  I noticed this because I have a label in a group box and it was more apparent so I thought I’d try it outside the groupbox.

Any ideas would be greatly appreciated.
Comment
Watch Question

Commented:
There seems to be no change between the font of the groupbox or the label.
See the attached screenshot.
you shoud have enabled label and disabled group box or vice versa
sshot.JPG

Author

Commented:
Okay so I don't know why you don't have the problem.  Mine is a VB app and that shouldn't make a difference.  Also I noticed you had the XP viisual look on and I don't know if that makes a difference or not.  I will try that.  Here is a screen shot of what I get.
untitled.JPG
Most Valuable Expert 2011
Top Expert 2015
Commented:
>>  There seems to be no change between the font of the groupbox or the label.

On your system. I think you've got something going on with your default fonts in SharpDevelop. Attached is an example of what the author is referring to.

I imagine GroupBox is doing some special painting in its OnPaint method. If you are that concerned about the difference, you could probably inherit GroupBox in a new Control and do custom painting, but I think that is probably more trouble than its worth.
Untitled.jpg
Most Valuable Expert 2011
Top Expert 2015

Commented:
I promise that Label4 is darker than GroupBox1, even though it doesn't look like it in that screenshot  :)

Author

Commented:
Okay... Go to display properties and then appearance...Then change your windows and buttons to Windows classic style.  Do you notice the problem I am seeing?  When I changed mine to Windows XP Style like you had then I don't notice the problem.  Can you reproduce what I am seeing when you change it?