www.pudn.com > EX_11.rar > page2.cpp


// page2.cpp : implementation file 
// 
 
#include "stdafx.h" 
#include "EX_11.h" 
#include "page2.h" 
 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
///////////////////////////////////////////////////////////////////////////// 
// Cpage2 property page 
 
IMPLEMENT_DYNCREATE(Cpage2, CPropertyPage) 
 
Cpage2::Cpage2() : CPropertyPage(Cpage2::IDD) 
{ 
	//{{AFX_DATA_INIT(Cpage2) 
	m_record = _T(""); 
	//}}AFX_DATA_INIT 
} 
 
Cpage2::~Cpage2() 
{ 
} 
 
void Cpage2::DoDataExchange(CDataExchange* pDX) 
{ 
	CPropertyPage::DoDataExchange(pDX); 
	//{{AFX_DATA_MAP(Cpage2) 
	DDX_Control(pDX, IDC_LIST1, m_list); 
	DDX_Text(pDX, IDC_EDIT_RECORD, m_record); 
	//}}AFX_DATA_MAP 
} 
 
 
BEGIN_MESSAGE_MAP(Cpage2, CPropertyPage) 
	//{{AFX_MSG_MAP(Cpage2) 
	ON_BN_CLICKED(IDC_BUTTON_ADD, OnButtonAdd) 
	//}}AFX_MSG_MAP 
END_MESSAGE_MAP() 
 
///////////////////////////////////////////////////////////////////////////// 
// Cpage2 message handlers 
 
BOOL Cpage2::OnInitDialog()  
{ 
	CPropertyPage::OnInitDialog(); 
	 
	// TODO: Add extra initialization here 
	 
	m_list.InsertColumn(0,"¼Ç ¼",LVCFMT_LEFT,150); //inital the list 
	return TRUE;  // return TRUE unless you set the focus to a control 
	              // EXCEPTION: OCX Property Pages should return FALSE 
} 
 
void Cpage2::OnButtonAdd()  
{ 
	// TODO: Add your control notification handler code here 
	int nItem = m_list.GetItemCount();	//Get the current list record count 
	CString text;						// 
	GetDlgItemText(IDC_EDIT_RECORD,text);//Get the text box value and envalute to text 
	m_list.InsertItem(nItem,_T(text));  //Insert record to List 
	 
}