topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Monday May 20, 2024, 9:29 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Recent Posts

Pages: [1] 2 3 4 5 6 ... 10next
1
C / C++ / Re: Static Text Control Font Size
« Last post by tez93 on April 02, 2009, 05:47 AM »

I was trying to work out how to do this myself recently and came up with another method as Visual Studio didn't seem to want to let me create a control variable for a static text control within a dialog.

Code: C++ [Select]
  1. CFont* g_hFont = NULL;
  2.  
  3. ...
  4.  
  5. case WM_INITDIALOG:
  6. {
  7.         if (g_hFont)
  8.         {
  9.                 delete g_hFont;
  10.                 g_hFont = NULL;
  11.         }
  12.  
  13.         g_hFont = new CFont;
  14.         g_hFont->CreatePointFont(140, _T("Verdana"));
  15.         CWnd::FromHandle(GetDlgItem(hDlg, IDC_STATIC_NAME))->SetFont(g_hFont, TRUE);
  16.  
  17.         return (INT_PTR)TRUE;
  18. }
  19.  
  20. ...

Pages: [1] 2 3 4 5 6 ... 10next