Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make the group box text to be disabled when group box is disabled?

Tags:

winapi

mfc

I facing issue with the group box text. I had disabled the groupbox by calling EnableWindow(FALSE), The problem is the group box title is not getting greyed out.

Can anyone please let me know why this is happening and how to get rid off this problem.

like image 250
Siva Avatar asked Oct 21 '14 07:10

Siva


1 Answers

This seems to be a bug in comctrl32.dll when visual styles are enabled.

I've made a very simple program that displays a dialog with an enabled and a disabled group box. Without visual styles the disabled group box is greyed out but with visual styles it is not:

Dialog withhout visual styles:

Without visual styles

The same dialog using visual styles:

With visual styles

Both Windows 7 and Windows XP suffer the same problem, I did'nt check on Windows 8. I'm afraid we have to live with that. The only possibility would be to draw the group box by yourself.

like image 68
Jabberwocky Avatar answered Sep 22 '22 14:09

Jabberwocky