Increase the Font of a Static Controls in DialogBox Controls
-
hi all, i want to Increase the Font of the Labels before all the Controls. is there any approach to increase the Font of a Static Control that we palce before all the Controls to Identify. i want to increase the Font Size of the Static Controls before the placed before the Controls in a Dialog Box. please let me know, uday. uday kiran
-
hi all, i want to Increase the Font of the Labels before all the Controls. is there any approach to increase the Font of a Static Control that we palce before all the Controls to Identify. i want to increase the Font Size of the Static Controls before the placed before the Controls in a Dialog Box. please let me know, uday. uday kiran
kiran janaswamy wrote:
i want to Increase the Font of the Labels
In the definition of your dialog (the .h file), include a CFont object (
m_font
). Initialise that font object in your constructor:// example only, use the large font you're after:
LOGFONT lf;
NONCLIENTMETRICS ncm;ncm.cbSize = sizeof(ncm);
VERIFY(SystemParametersInfo(SPI_GETNONCLIENTMETRICS, ncm.cbSize, &ncm, 0));
memcpy(&lf, &ncm.lfMessageFont, sizeof(LOGFONT));
m_font.CreateFontIndirect(&lf);Then in your OnInitDialog, get the CStatic object for the ontrol, and set it's font. Remember, you need to have named the object in the resources something other then IDC_STATIC.
CWnd *wnd = GetDlgItem(IDC_YOURCTRL);
ASSERT(wnd);
if (wnd) wnd->SetFont(&m_font);kiran janaswamy wrote:
before all the Controls.
Sorry, I don't understand what it is you're after with this bit.
- Dy
-
hi all, i want to Increase the Font of the Labels before all the Controls. is there any approach to increase the Font of a Static Control that we palce before all the Controls to Identify. i want to increase the Font Size of the Static Controls before the placed before the Controls in a Dialog Box. please let me know, uday. uday kiran
use createfont and then SetFont
-
use createfont and then SetFont
hi WhiteSky, i am very much thankfull to your suggestions. i got it. uday. uday kiran