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

📄 subtest.cpp

📁 Visual C++下的界面设计
💻 CPP
字号:
// subedit.cpp : SubClassed Edit control example
//
// This is a part of the Microsoft Foundation Classes C++ library.
// Copyright (C) 1992-1998 Microsoft Corporation
// All rights reserved.
//
// This source code is only intended as a supplement to the
// Microsoft Foundation Classes Reference and related
// electronic documentation provided with the library.
// See these sources for detailed information regarding the
// Microsoft Foundation Classes product.

#include "stdafx.h"
#include "ctrltest.h"

#include "paredit.h"

/////////////////////////////////////////////////////////////////////////////
// Dialog class

class CSubEditDlg : public CDialog
{
protected:
	CParsedEdit edit1, edit2, edit3, edit4;
public:
	//{{AFX_DATA(CSubEditDlg)
		enum { IDD = IDD_SUB_EDIT };
	//}}AFX_DATA
	CSubEditDlg()
		: CDialog(CSubEditDlg::IDD)
			{ }

	BOOL OnInitDialog();
	//{{AFX_MSG(CSubEditDlg)
		virtual void OnOK();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

BEGIN_MESSAGE_MAP(CSubEditDlg, CDialog)
	//{{AFX_MSG_MAP(CSubEditDlg)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()


BOOL CSubEditDlg::OnInitDialog()
{
	edit1.SubclassEdit(IDC_EDIT1, this, PES_LETTERS);
	edit2.SubclassEdit(IDC_EDIT2, this, PES_NUMBERS);
	edit3.SubclassEdit(IDC_EDIT3, this, PES_NUMBERS | PES_LETTERS);
	edit4.SubclassEdit(IDC_EDIT4, this, PES_ALL);
	return TRUE;
}

void CSubEditDlg::OnOK()
{
#ifdef _DEBUG
	// dump results, normally you would do something with these
	CString s;
	edit1.GetWindowText(s);
	TRACE1("edit1 = '%s'\n", s);
	edit2.GetWindowText(s);
	TRACE1("edit2 = '%s'\n", s);
	edit3.GetWindowText(s);
	TRACE1("edit3 = '%s'\n", s);
	edit4.GetWindowText(s);
	TRACE1("edit4 = '%s'\n", s);
#endif

	EndDialog(IDOK);
}

/////////////////////////////////////////////////////////////////////////////
// Run the test

void CTestWindow::OnTestSubclassedEdit()
{
	TRACE0("running dialog containing edit items aliased to ParsedEdits\n");
	CSubEditDlg dlg;
	dlg.DoModal();
}


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

⌨️ 快捷键说明

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