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

📄 ctoobardemoview.cpp

📁 精通MFC程序设计
💻 CPP
字号:
// CToobarDemoView.cpp : implementation of the CCToobarDemoView class
//

#include "stdafx.h"
#include "CToobarDemo.h"

#include "MainFrm.h"
#include "CToobarDemoDoc.h"
#include "CToobarDemoView.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CCToobarDemoView

IMPLEMENT_DYNCREATE(CCToobarDemoView, CView)

BEGIN_MESSAGE_MAP(CCToobarDemoView, CView)
	//{{AFX_MSG_MAP(CCToobarDemoView)
		// NOTE - the ClassWizard will add and remove mapping macros here.
		//    DO NOT EDIT what you see in these blocks of generated code!
	//}}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)
	ON_CBN_SELCHANGE(IDC_COMBOX, OnSelchangeCombo)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CCToobarDemoView construction/destruction

CCToobarDemoView::CCToobarDemoView()
{
	// TODO: add construction code here

}

CCToobarDemoView::~CCToobarDemoView()
{
}

BOOL CCToobarDemoView::PreCreateWindow(CREATESTRUCT& cs)
{
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs

	return CView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CCToobarDemoView drawing

void CCToobarDemoView::OnDraw(CDC* pDC)
{
	CCToobarDemoDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	// TODO: add draw code for native data here
}

/////////////////////////////////////////////////////////////////////////////
// CCToobarDemoView printing

BOOL CCToobarDemoView::OnPreparePrinting(CPrintInfo* pInfo)
{
	// default preparation
	return DoPreparePrinting(pInfo);
}

void CCToobarDemoView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add extra initialization before printing
}

void CCToobarDemoView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add cleanup after printing
}

/////////////////////////////////////////////////////////////////////////////
// CCToobarDemoView diagnostics

#ifdef _DEBUG
void CCToobarDemoView::AssertValid() const
{
	CView::AssertValid();
}

void CCToobarDemoView::Dump(CDumpContext& dc) const
{
	CView::Dump(dc);
}

CCToobarDemoDoc* CCToobarDemoView::GetDocument() // non-debug version is inline
{
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CCToobarDemoDoc)));
	return (CCToobarDemoDoc*)m_pDocument;
}

void CCToobarDemoView::OnSelchangeCombo() 


{
	CString m_text;
	CMainFrame* frame=(CMainFrame*)AfxGetMainWnd();
	frame->m_pCombo.GetLBText(frame->m_pCombo.GetCurSel(),m_text);
	AfxMessageBox("你选择的是:"+m_text);
}


#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CCToobarDemoView message handlers

⌨️ 快捷键说明

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