關於CSplitterWnd的一個問題.

AsonJia 2002-12-03 09:08:49
我使用這個類建立了切分窗口,但是剛剛建立的時候,切分窗口好像都擠在了一起,後來我想使用SetRowInfo函數來分開,但是居然分不開,高手指教該怎麼板,相關的代碼如下;
bResult=m_wndSplitter0.CreateStatic(this,2,1);
if(bResult==FALSE)
return FALSE;
m_wndSplitter0.SetRowInfo(1,100,0); //這一句沒起到作用.
...全文
37 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
AsonJia 2002-12-04
  • 打赏
  • 举报
回复
我修改了原來的程序,變成這樣了,但是還是不行,高手們指點一下吧.
m_wndSplitter1.SetColumnInfo(0,cr.Width()/5,0);
bResult=m_wndSplitter1.CreateView(0,1,RUNTIME_CLASS(CFileView),CSize(cr.Width()*(2/3),cr.Height()*(2/3)),pContext);
if(bResult==FALSE)
return FALSE;
bResult=m_wndSplitter1.CreateView(0,0,RUNTIME_CLASS(CFolderView),CSize(cr.Width()/3,cr.Height()/3),pContext);
if(bResult==FALSE)
return FALSE;
m_wndSplitter1.RecalcLayout();

所有的視還是全部擠在了一起.怎麼吧
lipeipei 2002-12-03
  • 打赏
  • 举报
回复

试试这个
BOOL CChildFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
// TODO: Add your specialized code here and/or call the base class
m_wndSplitter1.CreateStatic(this,1,2);
m_wndSplitter1.CreateView(0,0,RUNTIME_CLASS(AAAView),CSize(300,0),pContext);
m_wndSplitter2.CreateStatic(&m_wndSplitter1,2,1,WS_CHILD|WS_VISIBLE,m_wndSplitter1.IdFromRowCol(0,1));
m_wndSplitter2.CreateView(0,0,RUNTIME_CLASS(AAAView),CSize(0,500),pContext);
m_wndSplitter2.CreateView(1,0,RUNTIME_CLASS(AAAView),CSize(0,0),pContext);
return TRUE;
//return CMDIChildWnd::OnCreateClient(lpcs, pContext);
}

15,978

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧