The following demo loads a frame on a dialog window and sets it to Bold...
Can someone please tell me how to modify it to change the colour of that control? many thanks!
------------------
Can someone please tell me how to modify it to change the colour of that control? many thanks!
Code:
#COMPILE EXE #INCLUDE "win32api.inc" GLOBAL hDlg AS LONG SUB MakeBold(FontObject AS LONG) ON ERROR RESUME NEXT LOCAL hFont AS LONG LOCAL lf AS LOGFONT CONTROL SEND hDlg, FontObject, %WM_GETFONT, 0, 0 TO hFont GetObject hFont, SIZEOF(lf), BYVAL VARPTR(lf) lf.lfWeight = %FW_BOLD hFont = CreateFontIndirect(lf) CONTROL SEND hDlg, FontObject, %WM_SETFONT,hFont, 1 END SUB FUNCTION WinMain (BYVAL hInstance AS LONG, _ BYVAL hPrevInstance AS LONG, _ lpCmdLine AS ASCIIZ PTR, _ BYVAL iCmdShow AS LONG) AS LONG ON ERROR RESUME NEXT Dialog New 0, "Font Test", ,, 203, 89, %WS_CAPTION Or %WS_SYSMENU + %WS_MINIMIZEBOX, To hDlg CONTROL ADD FRAME, hDlg, 99, "Caption", 3 ,10, 200,40, %BS_CENTER, 0 CALL MAKEBOLD(99) DIM hDC AS LONG Dialog Show Modal hDlg End Function
Comment