在基于CDockablePane的视图类CMydockView的OnCreatClient进行拆分~
BOOL CMydockView::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
//
// Note: Create the CFileView first so the CDriveView's OnInitialUpdate
// function can call OnUpdate on the CFileView.
//
if (!m_wndSplitter.CreateStatic (this, 1, 2) ||
!m_wndSplitter.CreateView (0, 1, RUNTIME_CLASS
(CTestDockView), CSize (0, 0), pContext) ||
!m_wndSplitter.CreateView (0, 0, RUNTIME_CLASS (CTestDockView),
CSize (48, 0), pContext))
return FALSE; return TRUE;
}
为啥出不来?感觉面板客户端像是透明了似的,啥也没有,程序一激活时,面板居然显示程序后边的其他程序窗口相同位置中的内容~~~~
BOOL CMydockView::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
//
// Note: Create the CFileView first so the CDriveView's OnInitialUpdate
// function can call OnUpdate on the CFileView.
//
if (!m_wndSplitter.CreateStatic (this, 1, 2) ||
!m_wndSplitter.CreateView (0, 1, RUNTIME_CLASS
(CTestDockView), CSize (0, 0), pContext) ||
!m_wndSplitter.CreateView (0, 0, RUNTIME_CLASS (CTestDockView),
CSize (48, 0), pContext))
return FALSE; return TRUE;
}
为啥出不来?感觉面板客户端像是透明了似的,啥也没有,程序一激活时,面板居然显示程序后边的其他程序窗口相同位置中的内容~~~~
void CMydockView::OnPaint()
{
CPaintDC dc(this); // 用于绘制的设备上下文 CRect allRect;
GetClientRect(allRect);
CBrush* whitebrs=new CBrush(RGB(255,255, 255));
dc.FillRect(allRect,whitebrs);//将工作区填充为白色
//在此后添加其他控件的重绘
}