BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT /*lpcs*/,
CCreateContext* pContext)
{
....
m_bSplitterCreated=true; //Add this boolean var in CMainFrame
// and set default value to false in
// constructor.
return TRUE;
}
void CMainFrame::OnSize(UINT nType, int cx, int cy)
{
CFrameWnd::OnSize(nType, cx, cy); //Donnot forgot call base class OnSize.
CRect rc;
GetClientRect(&rc); int w1 = rc.Width() * 2/3;
int w2 = rc.Width() /3; if( m_bSplitterCreated ) // Check if the splitter created!!!!
{ m_wndSplitter1.SetColumnInfo(0, w1, 0);
m_wndSplitter1.SetColumnInfo(1, w2, 0); m_wndSplitter1.RecalcLayout();
}
}
CCreateContext* pContext)
{
....
m_bSplitterCreated=true; //Add this boolean var in CMainFrame
// and set default value to false in
// constructor.
return TRUE;
}
void CMainFrame::OnSize(UINT nType, int cx, int cy)
{
CFrameWnd::OnSize(nType, cx, cy); //Donnot forgot call base class OnSize.
CRect rc;
GetClientRect(&rc); int w1 = rc.Width() * 2/3;
int w2 = rc.Width() /3; if( m_bSplitterCreated ) // Check if the splitter created!!!!
{ m_wndSplitter1.SetColumnInfo(0, w1, 0);
m_wndSplitter1.SetColumnInfo(1, w2, 0); m_wndSplitter1.RecalcLayout();
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货