SetFont at Runtime
-
Hi, im using the below code to increase the size of the DialogBox along with the controls inside it during Runtime...ie im overriding DoModal()function... CTestDlg is my application name.... INT_PTR CTestDlg::DoModal() { CDialogTemplate dlt; int nResult; // load dialog template //CTestDlg::IDD is the ID of my resoource... if (!dlt.Load(MAKEINTRESOURCE(CTestDlg::IDD))) return -1; // set your own font, for example "Arial", 10 pts. dlt.SetFont(L"Arial", 12); // get pointer to the modified dialog template LPSTR pdata = (LPSTR)GlobalLock(dlt.m_hTemplate); // let MFC know that you are using your own template m_lpszTemplateName = NULL; InitModalIndirect(pdata); // display dialog box nResult = CDialog::DoModal(); // unlock memory object GlobalUnlock(dlt.m_hTemplate); return nResult; } The issue is the font of one of the control (CheckBox) is not getting increased... Please let me know...