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

📄 dialoginsert.cpp

📁 MFC设计通讯录
💻 CPP
字号:
// DialogInsert.cpp : implementation file
//

#include "stdafx.h"
#include "Dialog.h"
#include "DialogInsert.h"

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

/////////////////////////////////////////////////////////////////////////////
// CDialogInsert dialog


CDialogInsert::CDialogInsert(CWnd* pParent /*=NULL*/)
	: CDialog(CDialogInsert::IDD, pParent)
{
	//{{AFX_DATA_INIT(CDialogInsert)
	m_InsertShengxiao = _T("");
	m_date = 0;
	m_name = _T("");
	m_InsertEmail = _T("");
	m_InsertAddr = _T("");
	m_InsertMemo = _T("");
	m_InsertPhone = _T("");
	//}}AFX_DATA_INIT
}


void CDialogInsert::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CDialogInsert)
	DDX_Control(pDX, IDC_RICHEDIT_EMAIL, m_RichEditCtrl);
	DDX_Control(pDX, IDC_RADIO2, m_radio2);
	DDX_Control(pDX, IDC_RADIO1, m_radio1);
	DDX_CBString(pDX, IDC_COMBO_SHENGXIAO, m_InsertShengxiao);
	DDX_DateTimeCtrl(pDX, IDC_DATETIMEPICKER_BORN, m_date);
	DDX_Text(pDX, IDC_EDIT_NAME, m_name);
	DDX_Text(pDX, IDC_RICHEDIT_EMAIL, m_InsertEmail);
	DDX_Text(pDX, IDC_EDIT_INSERT_ADDR, m_InsertAddr);
	DDX_Text(pDX, IDC_EDIT_INSERT_MEMO, m_InsertMemo);
	DDX_Text(pDX, IDC_EDIT_PHONE, m_InsertPhone);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CDialogInsert, CDialog)
	//{{AFX_MSG_MAP(CDialogInsert)
	ON_BN_CLICKED(IDC_RADIO1, OnRadio1)
	ON_BN_CLICKED(IDC_RADIO2, OnRadio2)
	ON_BN_CLICKED(IDC_BUTTON_INSERTDETAIL, OnButtonInsertdetail)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CDialogInsert message handlers

BOOL CDialogInsert::OnInitDialog() 
{
	CDialog::OnInitDialog();
	 
	CHARFORMAT   cf;   
	
	m_radio1.SetCheck(1);
	m_radio2.SetCheck(0);
	m_InsertSex=true;
	m_InsertShengxiao="猪";
	UpdateData(false);
	m_RichEditCtrl.SetBackgroundColor(0,255); 

	cf.dwMask   =CFM_BOLD|CFM_COLOR|CFM_FACE|CFM_ITALIC|CFM_SIZE;
	cf.crTextColor   =   RGB(0,255,0);
	 cf.dwEffects   =   CFE_BOLD|CFE_ITALIC; 
	
	 m_RichEditCtrl.SetDefaultCharFormat(cf);	// TODO: Add extra initialization here
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CDialogInsert::OnRadio1() 
{
	// TODO: Add your control notification handler code here
	m_InsertSex=true;
	m_radio1.SetCheck(1);
	m_radio2.SetCheck(0);
}

void CDialogInsert::OnRadio2() 
{
	// TODO: Add your control notification handler code here
	m_InsertSex=false;
	m_radio1.SetCheck(0);
	m_radio2.SetCheck(1);
}

void CDialogInsert::OnButtonInsertdetail() 
{
	// TODO: Add your control notification handler code here
	UpdateData(true);
	CDialog::OnOK();
}

⌨️ 快捷键说明

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