MFC 分割界面有关问题
MFC 分割界面问题
要做一个界面分割,如图所示,其他的我都弄好了,就是右下角那个分割面,我用的是CEDITVIEW,想请教大家怎么能如图中一样可以显示标题了?
------解决方案--------------------
有了上面的设置:
还需要自己改写(SetWindowText()因为它会写到客户区!)
1.h
class CMyView : public CEditView
{
protected:
CMyView(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(CMyView)
CString m_Title;
// Operations
public:
void SetTitle(LPCSTR Title);
2.cpp
void CMyView::SetTitle(LPCSTR Title)
{
m_Title=Title;
}
3. cpp
void CMyView::OnNcPaint()
{
// TODO: Add your message handler code here
CEditView::OnNcPaint();// for painting messages
CWindowDC dc(this);
dc.SetBkMode(TRANSPARENT);
dc.TextOut(30,2,m_Title,m_Title.GetLength());
}
要做一个界面分割,如图所示,其他的我都弄好了,就是右下角那个分割面,我用的是CEDITVIEW,想请教大家怎么能如图中一样可以显示标题了?
------解决方案--------------------
有了上面的设置:
还需要自己改写(SetWindowText()因为它会写到客户区!)
1.h
class CMyView : public CEditView
{
protected:
CMyView(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(CMyView)
CString m_Title;
// Operations
public:
void SetTitle(LPCSTR Title);
2.cpp
void CMyView::SetTitle(LPCSTR Title)
{
m_Title=Title;
}
3. cpp
void CMyView::OnNcPaint()
{
// TODO: Add your message handler code here
CEditView::OnNcPaint();// for painting messages
CWindowDC dc(this);
dc.SetBkMode(TRANSPARENT);
dc.TextOut(30,2,m_Title,m_Title.GetLength());
}