在资源里改吧.
IDD_MYDLG_DIALOG DIALOGEX 0, 0, 236, 166 // 这四个数字决定对话框大小
STYLE WS_POPUP | WS_CHILD | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "文字边框和底纹"
FONT 9, "宋体" // 这儿设置字体和大小
BEGIN
...
END
IDD_MYDLG_DIALOG DIALOGEX 0, 0, 236, 166 // 这四个数字决定对话框大小
STYLE WS_POPUP | WS_CHILD | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "文字边框和底纹"
FONT 9, "宋体" // 这儿设置字体和大小
BEGIN
...
END
.....
pointer->SendMessage(WM_SETFONT,(DWORD)&font,0);
就可以了
GetWindowRect(rectWnd);
SetWindowPos(NULL, 0, 0,
rectWnd.Width() + 100,
rectWnd.Height(),
SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE);
字体是标签上的字体?如果是的话
We can change the font used by the tab control to draw the labels by using the SetFont() function in the CWnd class. The code given below is very simple and does not bother with resizing the tab control or the property sheet. This works fine for fonts that are smaller than the font being used by the tab control or about the same size. A good place to put this code in is the OnInitDialog() of the CPropertySheet derived class.
// m_fontEdit is a member variable
// Create a bold font
m_fontEdit.CreateFont( -8, 0, 0, 0, 700, 0, 0, 0, 1,
0, 0, 0, 0, _T("MS Sans Serif") );
GetTabControl()->SetFont( &m_fontEdit );
摘自vckbase
我要改的不是标题栏的字体,而是属性页里面所有控件的字体。
在资源里改是没有用的。
我用了SetFont,但没有效果,不知道对字体是不是有什么限制?
然后在初始化中创建字体,添加控件时使用这个字体
pCtrl->SetFont(&m_font);