C language > Beginner questions
GroupBox title text color
John Z:
Hi Experts!
Is is possible to set the color of the title for a GroupBox without doing something like 'owner draw? Been wracking my brain and burning up the keyboard trying things.
See circled item in the attachment. I can change the font and language, no problem, but can't seem to change the color for this box's title. In my dark mode one can't read it :(
Any help appreciated ...even if it is "no it can't be done" :)
Thanks,
John Z
TimoVJL:
So same problem as here:
How do I set the font and color for a group box caption using Win32
John Z:
Thanks TimoVJL,
Maybe so but I can set font, text and size, just not color. That site is blocked for me at the present time, I might try a VPN to it later.
John Z
John Z:
Thanks TimoVJL
--- Quote from: TimoVJL on January 13, 2024, 09:58:22 AM ---So same problem as here:
How do I set the font and color for a group box caption using Win32
--- End quote ---
I finally got in! Yes, looks like my issue and a possible way to solve it without owner draw but not mentioned directly. I’ll let you know.
Appreciate the help!
John Z
MrBcx:
It is possible to change the background of the Group text but changing its text color eludes me.
Here is the BCX code that produces the app in the screenshot.
If you want the generated C/C++ code, download the translator:
https://bcxbasiccoders.com/smf/index.php?topic=990.0
--- Code: ---GUI "Form1", PIXELS
CONST Grp1_Style = WS_CHILD|WS_VISIBLE|WS_GROUP|WS_TABSTOP|BS_GROUPBOX
CONST Grp1_ExtStyle = 0
ENUM
ID_Grp1
END ENUM
GLOBAL Form1 AS HWND
GLOBAL hGrp1 AS CONTROL
SUB FORMLOAD()
Form1 = BCX_FORM("Form1", 0, 0, 463, 316)
hGrp1 = BCX_GROUP("Group", Form1, ID_Grp1, 22, 25, 281, 190, Grp1_Style, Grp1_ExtStyle)
CENTER(Form1)
SHOW(Form1)
END SUB
BEGIN EVENTS
SELECT CASE CBMSG
'***********************************************************************
CASE WM_CTLCOLORSTATIC
'***********************************************************************
SELECT CASE (HWND) CBLPARAM
CASE hGrp1 : FUNCTION = BCX_SETCOLOR(RGB(255, 0, 0), RGB(200, 255, 200))
END SELECT
END SELECT
END EVENTS
--- End code ---
Navigation
[0] Message Index
[#] Next page
Go to full version