if(!splitter.CreateStatic(this,1,2))
{
return FALSE;
}
CRect cr;
GetClientRect(&cr); //绑定默认视图
if(!splitter.CreateView(0,0,RUNTIME_CLASS(CSingle_Form_SplitView),CSize(0,0),pContext))
{
return FALSE;
}
//第二分/在左边子窗口分割上下
if(!splitter_top.CreateStatic(&splitter,2,1,WS_CHILD|WS_VISIBLE|WS_BORDER,splitter.IdFromRowCol(0,1)))
{
return FALSE;
}
============================================================================================================
/*if(!splitter_top.CreateView(0,0,RUNTIME_CLASS(CSingle_Form_SplitView),CSize(0,840),pContext))
{
return FALSE;
}*/这一部分设置的840就有用为何下边设置的150就没用那!
============================================================================================================
//第三分/在左边较大窗口中继续分
if(!splitter_bot.CreateStatic(&splitter_top,2,2,WS_CHILD|WS_VISIBLE|WS_BORDER,splitter_top.IdFromRowCol(0,0)))
{
return FALSE;
}
if(!splitter_bot.CreateView(0,0,RUNTIME_CLASS(CSingle_Form_SplitView),CSize(cr.Width(),cr.Height()/2),pContext))
{
return FALSE;
}
if(!splitter_bot.CreateView(0,1,RUNTIME_CLASS(CSingle_Form_SplitView),CSize(150,150),pContext))
{
return FALSE;
}
if(!splitter_bot.CreateView(1,0,RUNTIME_CLASS(CSingle_Form_SplitView),CSize(150,150),pContext))
{
return FALSE;
}
if(!splitter_bot.CreateView(1,1,RUNTIME_CLASS(CFormTop),CSize(150,150),pContext))
{
return FALSE;
}
if(!splitter_top.CreateView(1,0,RUNTIME_CLASS(CSingle_Form_SplitView),CSize(cr.Width(),cr.Height()/2),pContext))
{
return FALSE;
}

解决方案 »

  1.   

    splitter的最后一栏/列是根据剩下多少来决定尺寸的。前面没有创建View,后面设if(!splitter_top.CreateView(1,0,RUNTIME_CLASS(CSingle_Form_SplitView),CSize(cr.Width(),cr.Height()/2),pContext)),这个尺寸无效的,会自动充满客户区。
    在之前加上:
    splitter_top.SetRowInfo(0, 400, 300);
    数字乱写的,自己调
      

  2.   

    没看见?
    splitter_top第0行没有创建view,要:
    splitter_top.SetRowInfo(0, 400, 300);
      

  3.   

    我以为是在splitter_bot.CreateView(1,0,RUNTIME_CLASS(CSingle_Form_SplitView),CSize(150,150),pContext)
    这里边直接设置的;
    因为我第三次没分之前那个参数还是有用的;
    如果说这样直接设置父窗口那下边的4个小窗口的大小如何设置;