楼主可以这么做(就是方法比较戳):在第一次分割的时候先CreateView,指定Size,在第二次分割的时候先DeleteView,再CreateView,这样就不会有视图隐藏的情况了。
if ( !m_split.CreateStatic(this, 1, 2) ){
return FALSE
}
if (!m_split.CreateView(0, 0, RUNTIME_CLASS(CMy003View),
CSize(200,100), pContext) ||
!m_split.CreateView(0, 1, RUNTIME_CLASS(CMy003View),
CSize(200,100), pContext))
{
m_split.DestroyWindow()
return FALSE
}
m_split.DeleteView(0,0)
if ( !m_splitLeft.CreateStatic(&m_split, 2, 1, WS_CHILD | WS_VISIBLE,
m_split.IdFromRowCol(0,0)) )
{
return FALSE
}
if ( !m_splitLeft.CreateView(0, 0, RUNTIME_CLASS(CMy003View),
CSize(200,100), pContext) ||
!m_splitLeft.CreateView(1, 0, RUNTIME_CLASS(CMy003View),
CSize(200,100), pContext) )
{
m_splitLeft.DestroyWindow()
return FALSE
}
return TRUE
运行结果:
if (!m_wndSplitter1.CreateStatic(this,1,2))=》
if (!m_wndSplitter1.CreateStatic(this,2,1))
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)