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

📄 fonttab.cpp

📁 VC++6开发指南的源代码第7章-第11章
💻 CPP
字号:
// FontTab.cpp : implementation file
//

#include "stdafx.h"
#include "TabDlgDemo.h"
#include "FontTab.h"

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

/////////////////////////////////////////////////////////////////////////////
// CFontTab dialog


CFontTab::CFontTab(CWnd* pParent /*=NULL*/)
	: CDialog(CFontTab::IDD, pParent)
{
	//{{AFX_DATA_INIT(CFontTab)
	m_radio = 0;
	m_height = 0;
	//}}AFX_DATA_INIT
}


void CFontTab::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CFontTab)
	DDX_Radio(pDX, IDC_RADIO1, m_radio);
	DDX_Text(pDX, IDC_EDIT1, m_height);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CFontTab, CDialog)
	//{{AFX_MSG_MAP(CFontTab)
	ON_BN_CLICKED(IDC_RADIO1, OnRadio1)
	ON_BN_CLICKED(IDC_RADIO2, OnRadio2)
	ON_BN_CLICKED(IDC_RADIO3, OnRadio3)
	ON_BN_CLICKED(IDC_RADIO4, OnRadio4)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CFontTab message handlers

void CFontTab::OnRadio1() 
{
	// TODO: Add your control notification handler code here
	m_radio=0;
	GetDlgItem(IDC_EDIT1)->EnableWindow(false);//编辑框禁止输入
	
}

void CFontTab::OnRadio2() 
{
	// TODO: Add your control notification handler code here
	m_radio=1;
	GetDlgItem(IDC_EDIT1)->EnableWindow(false);//编辑框禁止输入
	
}

void CFontTab::OnRadio3() 
{
	// TODO: Add your control notification handler code here
	m_radio=2;
	GetDlgItem(IDC_EDIT1)->EnableWindow(false);//编辑框禁止输入
	
}

void CFontTab::OnRadio4() 
{
	// TODO: Add your control notification handler code here
	m_radio=3;
	GetDlgItem(IDC_EDIT1)->EnableWindow(true);//编辑框允许输入
	
}

BOOL CFontTab::OnInitDialog() 
{
	CDialog::OnInitDialog();
	// TODO: Add extra initialization here
	GetDlgItem(IDC_EDIT1)->EnableWindow(false);//编辑框禁止输入
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

⌨️ 快捷键说明

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