class CSplitterWnd :public CSplitterWnd
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;
}
文章来源: zzzili.blog.csdn.net,作者:清雨小竹,版权归原作者所有,如需转载,请联系作者。
原文链接:zzzili.blog.csdn.net/article/details/8265448
- 点赞
- 收藏
- 关注作者
评论(0)