GroupBox Caption Size

GroupBox Caption Size

Post by vipi » Sat, 24 Jul 2004 14:59:40


Hi,
I have a groupbox control on a dialog.I want the caption of the groupbox
to appear in

1) Red
2) Point Size 20.

I was able to change the size[point (2)] of the caption by using the
WM_SETFONT from the WM_INITDIALOG of the Dialog box proceedure.

But what about the Text Color. Is there an easy way of doing this without
having to subclass the groupbox window and drawing the GroupBox myself?

thanks
vipin
 
 
 

GroupBox Caption Size

Post by John Carso » Sat, 24 Jul 2004 16:30:21


Pre-Windows XP, you can do this by processing WM_CTLCOLORSTATIC (yes, I know
that a group box is a button control, not a static control, but it sends
WM_CTLCOLORSTATIC to its parent nevertheless).

In Windows XP, the color of group box labels is part of the visual theme, so
changing it is harder work (and may be a bad idea).

--
John Carson
1. To reply to email address, remove donald
2. Don't reply to email address (post here instead)

 
 
 

GroupBox Caption Size

Post by vipi » Sat, 24 Jul 2004 17:33:07

Great, I tried the SetTextColor in WM_COLORSTATIC and it worked as you said
on windows 2000.

I haven't run and seen on windows XP to visualize the behaviour,but I assume
it is what you had said.

I had run a .NET example which uses Forms and it colors the GroupBox
caption in various colors on windows XP, that is what I saw yesterday.
Any clues,I don't want to do all the Subclassing stuff and then
drawing/painting the GroupBox myself, thats a bit of untidy work.

thanks
vipin





know
so
 
 
 

GroupBox Caption Size

Post by John Carso » Sat, 24 Jul 2004 18:10:53


I would put a static box on top of the group box and make it a child of the
group box so that painting is correct. I guess you will have to do this in
WM_INITDIALOG rather than in the resource editor.

--
John Carson
1. To reply to email address, remove donald
2. Don't reply to email address (post here instead)
 
 
 

GroupBox Caption Size

Post by vipi » Sat, 24 Jul 2004 18:40:20

yeah, looks like that has to be the way, atleast I will have some XP
specific code. But still not sure of the perfection,I gotto try.

thanks
vipin





the
 
 
 

GroupBox Caption Size

Post by vipi » Sat, 24 Jul 2004 21:04:49

Hi John,
I have a screenshot here:-

http://www.yqcomputer.com/

thanks
vipin






the
 
 
 

GroupBox Caption Size

Post by vipi » Sat, 24 Jul 2004 22:18:32

Hey John,
I tried on windows XP professional service pack and it is
working properly. So can you tell me why you had speicifically said pre-XP?
Does it happen with any specific XP flavor?

thanks
vipin




the
 
 
 

GroupBox Caption Size

Post by John Carso » Sun, 25 Jul 2004 00:19:34


XP Professional, SP1.

I am guessing that your program does not have a manifest. If the program has
no manifest, then WM_CTLCOLORSTATIC will work. Without a manifest, you get
XP-style caption bars but don't get a lot of the other Visual Styles stuff.

With a manifest, you get the full Visual Styles effect and WM_CTLCOLORSTATIC
doesn't work.


--
John Carson
1. To reply to email address, remove donald
2. Don't reply to email address (post here instead)
 
 
 

GroupBox Caption Size

Post by vipi » Sun, 25 Jul 2004 00:53:28

Hi John,
Its ok, I can leave without manifests for this particular
program, because the usage will be on 98,ME,NT,2000,XP.

thanks
vipin






has
stuff.
WM_CTLCOLORSTATIC
 
 
 

GroupBox Caption Size

Post by John Carso » Sun, 25 Jul 2004 00:59:04


Fine if that is what you want, but a manifest doesn't stop a program from
running on pre-XP systems.


--
John Carson
1. To reply to email address, remove donald
2. Don't reply to email address (post here instead)
 
 
 

GroupBox Caption Size

Post by vipi » Sun, 25 Jul 2004 01:32:47

I understand that,but I want this thing to work,thats why.

Any clues on the edit control and SetWindowRgn(...) stuff.

thanks
vipin
 
 
 

GroupBox Caption Size

Post by v-raygo » Sun, 25 Jul 2004 16:05:15

>Any clues on the edit control and SetWindowRgn(...) stuff.
Is this the same problem with "GroupBox and SetWindowRgn". Seems John had replied you
in that thread. And I can not repro your problem in my test either. If they are same,
could you reply to that thread and I will follow up you there. Thanks.


Have a nice day.
Rhett Gong [MSFT]
Microsoft Online Partner Support

This posting is provided "AS IS" with no warranties, and confers no rights.
Please reply to newsgroups only. Thanks.