⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tabctrlview.h

📁 VC++中Tab View的多种实现方法
💻 H
字号:
#if !defined(AFX_TABCTRLVIEW_H__E469C878_C97F_11D3_B1F4_00104B13D514__INCLUDED_)
#define AFX_TABCTRLVIEW_H__E469C878_C97F_11D3_B1F4_00104B13D514__INCLUDED_

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
// TabCtrlView.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// CViewTabCtrl window

 
class CTabCtrlView;

class CViewTabCtrl : public CTabCtrl
{
// Construction
public:
	CViewTabCtrl();

// Attributes
public:

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CViewTabCtrl)
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual void RecalcLayout(CRect &rect,CWnd * wnd);
	void SetView(CTabCtrlView * pView);
	virtual ~CViewTabCtrl();

	// Generated message map functions
protected:
	virtual BOOL HandleTabs(int sel);

	CTabCtrlView* m_pView;

	//{{AFX_MSG(CViewTabCtrl)
	afx_msg void OnSelchange(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	//}}AFX_MSG

	DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////



/////////////////////////////////////////////////////////////////////////////
// CTabCtrlView view

class CTabCtrlView : public CWnd
{
public:
	CTabCtrlView();           // protected constructor used by dynamic creation
	DECLARE_DYNCREATE(CTabCtrlView)

// Attributes
public:

// Operations
public:
	virtual CView * CreateView(CRuntimeClass * pViewClass,
		                       SIZE sizeInit,
		                       CCreateContext *pContext);

	BOOL CreateStatic(CWnd * pParentWnd,
		              DWORD dwstyle=WS_CHILD|WS_VISIBLE,
		              UINT nID=AFX_IDW_PANE_FIRST);

	CView* GetActiveView();
	void RecalcLayout();
	void SetTab(int iTab);
	BOOL HandleTabs(int iSel);
	void InitTabs( CTabCtrlView *pView);
	 ~CTabCtrlView();

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CTabCtrlView)
	protected:
	virtual void OnDraw(CDC* pDC);      // overridden to draw this view
	//}}AFX_VIRTUAL

// Implementation
public:
	CViewTabCtrl m_TabCtl;
	CView* m_ActiveView;

#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

	// Generated message map functions
protected:
	//{{AFX_MSG(CTabCtrlView)
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnPaint();
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_TABCTRLVIEW_H__E469C878_C97F_11D3_B1F4_00104B13D514__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -