我使用了CPropertySheet类以后,窗体的大小和字体的大小就无法自己控制了
都是系统给搞定(让系统设为一个默认值了)我创建了一个CPropertySheet的子类CMyPropertySheet
在里面写了一个函数进行调整,可惜无法实现
void CMyPropertySheet::SetRect(LPRECT lpRc)
{
CRect rectWnd;
GetWindowRect(rectWnd);
SetWindowPos(NULL, 0, 10,
lpRc->right - 10,
rectWnd.Height(),
SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE); // Increase width of the tab control by 100 pixel
GetTabControl()->GetWindowRect(rectWnd);
GetTabControl()->SetWindowPos(NULL, 0, 0,
lpRc->right- lpRc->left- 10+ rectWnd.left,
rectWnd.Height(),
SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE); // Increase the width of the property page by 100 pixels
CPropertyPage* pPage = GetActivePage();
pPage->GetWindowRect(rectWnd);
rectWnd.right= lpRc->right- lpRc->left- 10+ rectWnd.left;
ScreenToClient(rectWnd);
pPage->MoveWindow(rectWnd);}然后在使用CMyPropertySheet的对话框的OnSize里对该函数进行调用
m_Sheet.SetRect(&rc);
可惜无法达到调整窗体大小的目的(也尝试过在OnPaint里进行调用)。
另外小弟也尝试过改变窗体的字体大小:
在CMyProperySheet的OnInitDialog()里调用以下语句:
CFont *font = new CFont;
font->CreateFont(100, 0, 0, 0, 900, 0, 0, 0, ANSI_CHARSET,
OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH|FF_DONTCARE,
"arial");
SetFont(font);
可惜也无法达到调整字体大小的目的通过网上查证:CPropertySheet,MFC进行了默认处理
请各位高手大大指教:
如何将窗体大小加大,不受限制???
如何将字体自由变化?????
都是系统给搞定(让系统设为一个默认值了)我创建了一个CPropertySheet的子类CMyPropertySheet
在里面写了一个函数进行调整,可惜无法实现
void CMyPropertySheet::SetRect(LPRECT lpRc)
{
CRect rectWnd;
GetWindowRect(rectWnd);
SetWindowPos(NULL, 0, 10,
lpRc->right - 10,
rectWnd.Height(),
SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE); // Increase width of the tab control by 100 pixel
GetTabControl()->GetWindowRect(rectWnd);
GetTabControl()->SetWindowPos(NULL, 0, 0,
lpRc->right- lpRc->left- 10+ rectWnd.left,
rectWnd.Height(),
SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE); // Increase the width of the property page by 100 pixels
CPropertyPage* pPage = GetActivePage();
pPage->GetWindowRect(rectWnd);
rectWnd.right= lpRc->right- lpRc->left- 10+ rectWnd.left;
ScreenToClient(rectWnd);
pPage->MoveWindow(rectWnd);}然后在使用CMyPropertySheet的对话框的OnSize里对该函数进行调用
m_Sheet.SetRect(&rc);
可惜无法达到调整窗体大小的目的(也尝试过在OnPaint里进行调用)。
另外小弟也尝试过改变窗体的字体大小:
在CMyProperySheet的OnInitDialog()里调用以下语句:
CFont *font = new CFont;
font->CreateFont(100, 0, 0, 0, 900, 0, 0, 0, ANSI_CHARSET,
OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH|FF_DONTCARE,
"arial");
SetFont(font);
可惜也无法达到调整字体大小的目的通过网上查证:CPropertySheet,MFC进行了默认处理
请各位高手大大指教:
如何将窗体大小加大,不受限制???
如何将字体自由变化?????
http://www.codeproject.com/property/resizableproperties.aspResizable CPropertySheet
http://www.codeguru.com/Cpp/controls/propertysheet/sizing/article.php/c599/
// add a button.// CMySheet is derived from CPropertySheet
BOOL CMySheet::OnInitDialog()
{
CPropertySheet::OnInitDialog(); RECT rc;
GetWindowRect (&rc);
// Increase the height of the CPropertySheet by 30
rc.bottom += 30;
// Increase the width of CPropertySheet by 50
rc.right +=50;
// Resize the CPropertySheet
MoveWindow (rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top); // Convert to client coordinates
ScreenToClient (&rc);
// m_Button is of type CButton and is a member of CMySheet
m_Button.Create ("&MyButton", WS_CHILD | WS_VISIBLE | WS_TABSTOP,
CRect (5, rc.bottom-30, 80, rc.bottom-5), this, IDC_MYBUTTON);
return TRUE;
}