1.隐藏分割条 和 禁止拖动分割条
class CMySplitterWnd : public CSplitterWnd { public: int m_cx; int m_cy; void HideSplitter(); void ShowSplitter(); public: CMySplitterWnd(void); ~CMySplitterWnd(void); DECLARE_MESSAGE_MAP() afx_msg void OnLButtonDown(UINT nFlags, CPoint point); }; #include "StdAfx.h" #include "MySplitterWnd.h" CMySplitterWnd::CMySplitterWnd(void) { } CMySplitterWnd::~CMySplitterWnd(void) { } BEGIN_MESSAGE_MAP(CMySplitterWnd, CSplitterWnd) ON_WM_LBUTTONDOWN() END_MESSAGE_MAP() void CMySplitterWnd::OnLButtonDown(UINT nFlags, CPoint point) { // TODO: 在此添加消息处理程序代码和/或调用默认值 //CSplitterWnd::OnLButtonDown(nFlags, point); } void CMySplitterWnd::HideSplitter() { m_cx=m_cxSplitterGap;//save previous cx m_cy=m_cxSplitterGap;//save previous cy m_cxSplitterGap=1; m_cySplitterGap=1; } void CMySplitterWnd::ShowSplitter() { m_cxSplitterGap=m_cx; m_cySplitterGap=m_cy; }