In einem STATIC Teil des Textes mit Farbe ändern
-
Hallo zusammen,
ich gebe in einem STATIC (einem Label) Text aus. Dabei möchte, dass nur ein Teil davon blau gezeichnet wird. Um den gesamten Text blau zu machen, habe ich folgende Zeilen Code:
case WM_CTLCOLORSTATIC: if (((HWND)lParam) == GetDlgItem(hDlg, ID_DETAILS)) { if (_GetStartAction() == START_ACTION_ACKNOWLEDGE) { SetTextColor((HDC)wParam, RGB(255, 0, 0)); SetBkColor((HDC)wParam, GetSysColor(COLOR_BTNFACE)); return (int)GetSysColorBrush(COLOR_BTNFACE); } else if (_GetStartAction() == START_ACTION_NONE) { SetTextColor((HDC)wParam, RGB(0, 0, 255)); SetBkColor((HDC)wParam, GetSysColor(COLOR_BTNFACE)); return (int)GetSysColorBrush(COLOR_BTNFACE); } } break;
Wie schaffe ich es nun, dass nur ein Teil anders gezeichnet wird?
-
Nimm ein RTF Control oder zwei Labels
-
Jochen Kalmbach schrieb:
Nimm ein RTF Control oder zwei Labels
Daran hatte ich auch schon gedacht (das mit den zwei Labels). Meine Hoffnung war, dass es vielleicht noch n anderen Weg gegeben hätte ...
-
RTF hast Du schon zu hören bekommen.
Oder:
- Ownerdraw....
- oder nimm zwei Statics, die Du dynamisch positionierst.
-
Google "cstatic html codeproject"
http://www.codeproject.com/Articles/2900/XHTMLStatic-An-Extra-Lean-Custom-Control-to-Displa
http://www.codeproject.com/Articles/6996/CPPHtmlStatic-v1-2