on Aug 14th, 2016, 7:44pm, Jack Kelly wrote:Is there any way to get a different foreground color in an individual statictext control? |
|
The workaround I use is to replace the statictext control with a texteditor control configured to look the same. It's a bit messy but it works (LBB only):
Code: statictext #w.st, "This is a regular STATICTEXT control", 10, 10, 300, 30
stylebits #w.te, _ES_READONLY, _WS_HSCROLL or _WS_VSCROLL or _WS_DLGFRAME, 0, 0
texteditor #w.te, 10, 50, 300, 30
open "Colored statictext" for window as #w
hw = hwnd(#w)
calldll #user32, "SetMenu", hw as ulong, 0 as long, r as void
#w.te "!backcolor buttonface"
#w.te "!forecolor red"
#w.te "This is a TEXTEDITOR control masquerading as statictext";
#w.st "!setfocus"
wait
Richard.