www.gusucode.com > VC++的窗体TabView标签切换实现-源码程序 > VC++的窗体TabView标签切换实现-源码程序/code/Tab2View.cpp
// Tab2View.cpp : implementation of the CTab2View class // Download by http://www.NewXing.com #include "stdafx.h" #include "Tab2.h" #include "Tab2Doc.h" #include "Tab2View.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CTab2View IMPLEMENT_DYNCREATE(CTab2View, CView) BEGIN_MESSAGE_MAP(CTab2View, CView) //{{AFX_MSG_MAP(CTab2View) ON_WM_ERASEBKGND() //}}AFX_MSG_MAP // Standard printing commands ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint) ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint) ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview) END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CTab2View construction/destruction CTab2View::CTab2View() { // TODO: add construction code here } CTab2View::~CTab2View() { } BOOL CTab2View::PreCreateWindow(CREATESTRUCT& cs) { // TODO: Modify the Window class or styles here by modifying // the CREATESTRUCT cs return CView::PreCreateWindow(cs); } ///////////////////////////////////////////////////////////////////////////// // CTab2View drawing void CTab2View::OnDraw(CDC* pDC) { CTab2Doc* pDoc = GetDocument(); ASSERT_VALID(pDoc); // TODO: add draw code for native data here } ///////////////////////////////////////////////////////////////////////////// // CTab2View printing BOOL CTab2View::OnPreparePrinting(CPrintInfo* pInfo) { // default preparation return DoPreparePrinting(pInfo); } void CTab2View::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/) { // TODO: add extra initialization before printing } void CTab2View::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/) { // TODO: add cleanup after printing } ///////////////////////////////////////////////////////////////////////////// // CTab2View diagnostics #ifdef _DEBUG void CTab2View::AssertValid() const { CView::AssertValid(); } void CTab2View::Dump(CDumpContext& dc) const { CView::Dump(dc); } CTab2Doc* CTab2View::GetDocument() // non-debug version is inline { ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CTab2Doc))); return (CTab2Doc*)m_pDocument; } #endif //_DEBUG ///////////////////////////////////////////////////////////////////////////// // CTab2View message handlers BOOL CTab2View::OnEraseBkgnd(CDC* pDC) { // TODO: Add your message handler code here and/or call default return FALSE;//CView::OnEraseBkgnd(pDC); }