4 个解决方案
#1
就是在OnSize里面实现的。
用CSplitterWnd的SetRowInfo和SetColInfo来完成。
给你贴一段我的代码:
int i,j;
CRect rect;
GetClientRect(&rect);
j = rect.Width();
i = rect.Height();
m_wndSplitter1.SetRowInfo(0,i/3,10);
m_wndSplitter1.SetRowInfo(1,2*i/9,10);
m_wndSplitter1.SetRowInfo(2,4*i/9,10);
m_wndSplitter1.RecalcLayout();
m_wndSplitter2.SetColumnInfo(0,j/2,10);
m_wndSplitter2.SetColumnInfo(1,j/2,10);
m_wndSplitter2.RecalcLayout();
用CSplitterWnd的SetRowInfo和SetColInfo来完成。
给你贴一段我的代码:
int i,j;
CRect rect;
GetClientRect(&rect);
j = rect.Width();
i = rect.Height();
m_wndSplitter1.SetRowInfo(0,i/3,10);
m_wndSplitter1.SetRowInfo(1,2*i/9,10);
m_wndSplitter1.SetRowInfo(2,4*i/9,10);
m_wndSplitter1.RecalcLayout();
m_wndSplitter2.SetColumnInfo(0,j/2,10);
m_wndSplitter2.SetColumnInfo(1,j/2,10);
m_wndSplitter2.RecalcLayout();
#2
请问在哪个类里的OnSize?
#3
当然事在mainfrm.cpp中了!
#4
当然事在mainfrm.cpp中了!
#1
就是在OnSize里面实现的。
用CSplitterWnd的SetRowInfo和SetColInfo来完成。
给你贴一段我的代码:
int i,j;
CRect rect;
GetClientRect(&rect);
j = rect.Width();
i = rect.Height();
m_wndSplitter1.SetRowInfo(0,i/3,10);
m_wndSplitter1.SetRowInfo(1,2*i/9,10);
m_wndSplitter1.SetRowInfo(2,4*i/9,10);
m_wndSplitter1.RecalcLayout();
m_wndSplitter2.SetColumnInfo(0,j/2,10);
m_wndSplitter2.SetColumnInfo(1,j/2,10);
m_wndSplitter2.RecalcLayout();
用CSplitterWnd的SetRowInfo和SetColInfo来完成。
给你贴一段我的代码:
int i,j;
CRect rect;
GetClientRect(&rect);
j = rect.Width();
i = rect.Height();
m_wndSplitter1.SetRowInfo(0,i/3,10);
m_wndSplitter1.SetRowInfo(1,2*i/9,10);
m_wndSplitter1.SetRowInfo(2,4*i/9,10);
m_wndSplitter1.RecalcLayout();
m_wndSplitter2.SetColumnInfo(0,j/2,10);
m_wndSplitter2.SetColumnInfo(1,j/2,10);
m_wndSplitter2.RecalcLayout();
#2
请问在哪个类里的OnSize?
#3
当然事在mainfrm.cpp中了!
#4
当然事在mainfrm.cpp中了!