split.CreateStatic(this,2,1);
split1.CreateStatic(&split,1,2,WS_CHILD | WS_VISIBLE | WS_BORDER,split.IdFromRowCol(0,0));
split1.CreateView(0,0,RUNTIME_CLASS(CLeft),CSize(350,500),pContext);
split1.CreateView(0,1,RUNTIME_CLASS(CRight),CSize(350,500),pContext);
split.CreateView(1,0,RUNTIME_CLASS(information),CSize(700,100),pContext);为什么显示出来各个窗口的大小和设置的不一样,整个窗口只能看见类information那个窗口,要用鼠标拖动才能看见上面的那两个,这是怎么回事啊,请高手指教一下
解决方案 »
- 串口控件问题
- CListCtrl控件, 数据多了, 垂直滚条条有时候失灵(拖不动), 这是什么原因 ?
- CTreeCtrl::SortChildrenCB的使用问题
- 请问怎样自己做一个安装程序
- 请教一个关于CListCtrl的很菜的问题。请高手帮忙!!
- 使用waveInOpen函数时一直有错,waveInOpen()!=MMSYSERR_NOERROR,帮忙解决一下,谢谢!(
- 一个直接将exe简单改为OCX的程序
- 怎么移动位图?
- WIN32 DLL工程中如何导入一个OCX控件
- 自己写的一个屏幕监控 在WIN7和WIN10登录界面时,鼠标和键盘不能模拟的问题
- 请问如何用GDI实现透明功能呀.
- C/C++运行库或者WINDOWS API中有没有将CHAR字符串转换为时间格式的函数?
SetWindowPos(NULL,0,0,700,600,SWP_NOMOVE|SWP_NOZORDER);
split.CreateStatic(this,2,1);
split1.CreateStatic(&split,1,2,WS_CHILD | WS_VISIBLE | WS_BORDER,split.IdFromRowCol(1,0)); //这儿
split1.CreateView(0,0,RUNTIME_CLASS(CLeft),CSize(350,500),pContext);
//这儿:
split1.CreateView(0,1,RUNTIME_CLASS(CRight),CSize(350,500),pContext);
split.CreateView(0,0,RUNTIME_CLASS(information),CSize(700,100),pContext);
split1.CreateView(0,0,RUNTIME_CLASS(CLeft),CSize(350,500),pContext);
split1.CreateView(0,1,RUNTIME_CLASS(CRight),CSize(350,500),pContext);
//这儿:
split.CreateView(0,0,RUNTIME_CLASS(information),CSize(700,100),pContext);
我以前也遇到这个问题,
其实只要跟踪代码我们就很容易知道原因://MFC源码:
BOOL CSplitterWnd::CreateStatic(CWnd* pParentWnd,
int nRows, int nCols, DWORD dwStyle, UINT nID)
{
ASSERT(pParentWnd != NULL);
ASSERT(nRows >= 1 && nRows <= 16);
ASSERT(nCols >= 1 && nCols <= 16);
ASSERT(nCols > 1 || nRows > 1); // 1x1 is not permitted
ASSERT(dwStyle & WS_CHILD);
ASSERT(!(dwStyle & SPLS_DYNAMIC_SPLIT)); // can't have dynamic split ASSERT(m_nRows == 0 && m_nCols == 0); // none yet
m_nRows = m_nMaxRows = nRows;
m_nCols = m_nMaxCols = nCols;
//*********************问题出在这儿************************************* //
// create with zero minimum pane size
if (!CreateCommon(pParentWnd, CSize(0, 0), dwStyle, nID))
return FALSE;
//********************************************************************* // // all panes must be created with explicit calls to CreateView
return TRUE;
}因此解决办法也出来了,
其中一个比较简单的方法从CSplitterWnd继承一个类,改写CreateStatic 。
我晚上把我的例子发给你。