Fonts and Colors
-
Hi all :rose: =-=-=-=-= Can anyone tell me... how can I change the font color of a button in my NOT MFC JUST WIN32 Application. The button id is :
IDC_BUTTON1
Thanks. =-=-=-=-=-=-= The_Server :rose: -
Hi all :rose: =-=-=-=-= Can anyone tell me... how can I change the font color of a button in my NOT MFC JUST WIN32 Application. The button id is :
IDC_BUTTON1
Thanks. =-=-=-=-=-=-= The_Server :rose: -
Hi all :rose: =-=-=-=-= Can anyone tell me... how can I change the font color of a button in my NOT MFC JUST WIN32 Application. The button id is :
IDC_BUTTON1
Thanks. =-=-=-=-=-=-= The_Server :rose:You'll have to owner draw it, I'm afraid...this is a long standing omission of Win32. There are MFC classes to do this, but if you're working on raw Win32 you'll probably have to roll your own. If you do this, remember you could be running on a themed XP system so you'll need to implement both conventional (GDI) drawing and themed (UxTheme.dll) drawing. UxTheme is actually fun to work with (unlike GDI), so don't shy away from it... Anna :rose: Homepage | My life in tears "Be yourself - not what others think you should be" - Marcia Graesch "Anna's just a sexy-looking lesbian tart" - A friend, trying to wind me up. It didn't work. Trouble with resource IDs? Try the Resource ID Organiser Visual C++ Add-In
-
Hi all :rose: =-=-=-=-= Can anyone tell me... how can I change the font color of a button in my NOT MFC JUST WIN32 Application. The button id is :
IDC_BUTTON1
Thanks. =-=-=-=-=-=-= The_Server :rose:Unlike every other UI system in the world, you can't "set" the color of a Win32 control. Rather, you need to implement a WM_CTLCOLOR message handler in the Button's parent, and respond to it appropriately (check out MSDN for info.) Fonts are much simpler. In your dialog's WM_INITDIALOG, after calling the base class message handler, do a GetDlgItem(IDC_BUTTON1)->SetFont(yourfont); Make sure you keep the font handle around (i.e. don't create a CFont on the stack).
-
Hi all :rose: =-=-=-=-= Can anyone tell me... how can I change the font color of a button in my NOT MFC JUST WIN32 Application. The button id is :
IDC_BUTTON1
Thanks. =-=-=-=-=-=-= The_Server :rose:LOGFONT lf={0,0,0,0,0,0,0,0,0,0,0,0,0,"Times New Roman"}; HWND hwndButton=GetDlgItem(hDlg, IDC_BUTTON1); ret=SendMessage(hwndButton,WM_SETFONT,(WPARAM)lf, (LPARAM)TRUE); if ret = zero >> faile okay ?;P
-
LOGFONT lf={0,0,0,0,0,0,0,0,0,0,0,0,0,"Times New Roman"}; HWND hwndButton=GetDlgItem(hDlg, IDC_BUTTON1); ret=SendMessage(hwndButton,WM_SETFONT,(WPARAM)lf, (LPARAM)TRUE); if ret = zero >> faile okay ?;P
10x but my problem is with color.... evryone says owner draw owner draw. guess I'll have to own and draw... =-=-=-=-=-= The Server :rose:
-
10x but my problem is with color.... evryone says owner draw owner draw. guess I'll have to own and draw... =-=-=-=-=-= The Server :rose:
http://www.vnpal.com/skidrow/zip/subclass.zip try this example I am a beginner! :(