派生一个子类,重载下面这个函数,想画什么,全在你呀CSplitterWnd::OnDrawSplitter virtual void OnDrawSplitter( CDC* pDC, ESplitType nType, const CRect& rect );ParameterspDCA pointer to the device context in which to draw. If pDC is NULL, then CWnd::RedrawWindow is called by the framework and no split window is drawn.nTypeA value of the enum ESplitType, which can be one of the following: splitBox The splitter drag box. splitBar The bar that appears between the two split windows. splitIntersection The intersection of the split windows. This element will not be called when running on Windows 95. splitBorder The split window borders. rectA reference to a CRect object specifying the size and shape of the split windows.ResThis member function is called by the framework to draw and specify the exact characteristics of a splitter window. Override OnDrawSplitter for advanced customization of the imagery for the various graphical components of a splitter window. The default imagery is similar to the splitter in Microsoft Works for Windows or Microsoft Windows 95, in that the intersections of the splitter bars are blended together.For more on dynamic splitter windows, see "Splitter Windows" in the articleMultiple Document Types, Views, and Frame Windows in Visual C++ Programmer’s Guide, Technical Note 29, and the CSplitterWnd class overview.
virtual void OnDrawSplitter( CDC* pDC, ESplitType nType, const CRect& rect );ParameterspDCA pointer to the device context in which to draw. If pDC is NULL, then CWnd::RedrawWindow is called by the framework and no split window is drawn.nTypeA value of the enum ESplitType, which can be one of the following: splitBox The splitter drag box.
splitBar The bar that appears between the two split windows.
splitIntersection The intersection of the split windows. This element will not be called when running on Windows 95.
splitBorder The split window borders.
rectA reference to a CRect object specifying the size and shape of the split windows.ResThis member function is called by the framework to draw and specify the exact characteristics of a splitter window. Override OnDrawSplitter for advanced customization of the imagery for the various graphical components of a splitter window. The default imagery is similar to the splitter in Microsoft Works for Windows or Microsoft Windows 95, in that the intersections of the splitter bars are blended together.For more on dynamic splitter windows, see "Splitter Windows" in the articleMultiple Document Types, Views, and Frame Windows in Visual C++ Programmer’s Guide, Technical Note 29, and the CSplitterWnd class overview.
void CMySplitter::OnDrawSplitter(CDC* pDC, ESplitType nType, const CRect& rectArg)
{
CBitmap bt;
bt.LoadBitmap(IDB_TRIANGLE1);
BITMAP bitmap;
bt.GetBitmap(&bitmap);
CBrush bh(&bt);
CRect rt;
rt = rectArg;
//GetClientRect(&rt);
if (pDC == NULL)
{
RedrawWindow(rectArg, NULL, RDW_INVALIDATE|RDW_NOCHILDREN);
return;
}
if( nType == splitBar )
{
pDC->FillRect(rt,&bh);
}
bt.Detach();
CSplitterWnd::OnDrawSplitter(pDC,nType,rectArg);
}
还有就是m_cxBorderShare (按下鼠标时splitter拖动条的偏移量)要设成0才可以正常显示。
CSplitterWnd没有Ondraw这个虚函数,OnDrawSplitter应该就相当于OnDraw吧。