First read Minimum size splitter then try: CSplitterWnd::SetRowInfo (horizontal) Call this member function to set a new minimum height and ideal height for a row. The row minimum value determines when the row will be too small to be fully displayed. When the framework displays the splitter window, it lays out the panes in columns and rows according to their ideal dimensions, working from the upper-left to the lower-right corner of the splitter window's client area.
void CMyFrame::OnSize(UINT nType, int cx, int cy)
{
if(::IsWindow(m_wndSplitter.m_hWnd) && ::IsWindow(m_wndSplitter2.m_hWnd))
{
m_wndSplitter.SetRowInfo(0, cy*2/3, 10);
m_wndSplitter.SetRowInfo(1, cy/3, 10);
m\_wndSplitter2.SetColumnInfo(0, cx/4, 10);
m\_wndSplitter2.SetColumnInfo(1, cx\*3/4, 10);
RecalcLayout();
}
}
CSplitterWnd::SetColumnInfo (verticle) Call this member function to set a new minimum width and ideal width for a column. The column minimum value determines when the column will be too small to be fully displayed. When the framework displays the splitter window, it lays out the panes in columns and rows according to their ideal dimensions, working from the upper-left to the lower-right corner of the splitter window's client area. Example
void CChildFrame::OnSize(UINT nType, int cx, int cy)
{
CMDIChildWnd::OnSize(nType, cx, cy);
CRect rect;
GetWindowRect( &rect );
if( m_bSplitterCreated ) // m_bSplitterCreated set in OnCreateClient
{
m_wndSplitter.SetColumnInfo(0, rect.Width()/2, 10);
m_wndSplitter.SetColumnInfo(1, rect.Width()/2, 10);
m_wndSplitter.RecalcLayout();
}
}
CSplitterWnd::RecalcLayout Call this member function to correctly redisplay the splitter window after you have adjusted row and column sizes with the SetRowInfo and SetColumnInfo member functions. If you change row and column sizes as part of the creation process before the splitter window is visible, it is not necessary to call this member function.