要如何获得整个宽度(包扩没有显示的),不是所见的窗口宽度mfc window是这样球的:
int CMainWindow::OnCreate (LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate (lpCreateStruct) == -1)
return -1; //
// Initialize internal width and height values based on screen metrics.
//
CClientDC dc (this);
m_nCellWidth = dc.GetDeviceCaps (LOGPIXELSX);
m_nCellHeight = dc.GetDeviceCaps (LOGPIXELSY) / 4;
m_nRibbonWidth = m_nCellWidth / 2;
m_nViewWidth = (26 * m_nCellWidth) + m_nRibbonWidth;
m_nViewHeight = m_nCellHeight * 100;
return 0;
}
帮忙解释下,这个问题我问啦一天啦,,都没解决。。
int CMainWindow::OnCreate (LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate (lpCreateStruct) == -1)
return -1; //
// Initialize internal width and height values based on screen metrics.
//
CClientDC dc (this);
m_nCellWidth = dc.GetDeviceCaps (LOGPIXELSX);
m_nCellHeight = dc.GetDeviceCaps (LOGPIXELSY) / 4;
m_nRibbonWidth = m_nCellWidth / 2;
m_nViewWidth = (26 * m_nCellWidth) + m_nRibbonWidth;
m_nViewHeight = m_nCellHeight * 100;
return 0;
}
帮忙解释下,这个问题我问啦一天啦,,都没解决。。
如果你要控件的大小(控件没显示完全,因为你调整整个窗体框架的缘故)
控件指针->GetClientRect获得CRect,然后大小什么都可以从CRect调整
如果你整个窗体框架充满了整个屏幕,当中控件的大小是被局限的。