topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • Thursday April 18, 2024, 8:43 am
  • 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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - tez93 [ switch to compact view ]

Pages: [1]
1
C / C++ / Re: Static Text Control Font Size
« 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]