边做边玩,大概弄了快一个月,终于做出一个像样的了,不说了,代码贴出来和大家分享吧。
首先是创建两个分割视图
BOOL CChildFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
// TODO: Add your specialized code here and/or call the base class
CRect rect;
GetClientRect(&rect);
m_wndSplitter.CreateStatic(this,1,2);
// m_wndSplitter.CreateView( 0, 1, RUNTIME_CLASS(CMdiView),
m_wndSplitter.CreateView( 0, 1, RUNTIME_CLASS(CVarityView),
CSize(rect.Width()/2, rect.Height()), pContext );
m_wndSplitter.CreateView( 0, 0, RUNTIME_CLASS(CValueView),
CSize(rect.Width()/2, rect.Height()), pContext );
return TRUE;
// return CMDIChildWnd::OnCreateClient(lpcs, pContext);
}
然后是在两个视图中加入自绘的列表控件
void CValueView::OnInitialUpdate()
{
CScrollView::OnInitialUpdate();
CSize sizeTotal;
// TODO: calculate the total