www.pudn.com > EX_11.rar > page3.cpp
// page3.cpp : implementation file
//
#include "stdafx.h"
#include "EX_11.h"
#include "page3.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// Cpage3 property page
IMPLEMENT_DYNCREATE(Cpage3, CPropertyPage)
Cpage3::Cpage3() : CPropertyPage(Cpage3::IDD)
{
//{{AFX_DATA_INIT(Cpage3)
m_record = _T("");
//}}AFX_DATA_INIT
}
Cpage3::~Cpage3()
{
}
void Cpage3::DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
//{{AFX_DATA_MAP(Cpage3)
DDX_Control(pDX, IDC_LIST1, m_list);
DDX_Text(pDX, IDC_EDIT_RECORD, m_record);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(Cpage3, CPropertyPage)
//{{AFX_MSG_MAP(Cpage3)
ON_BN_CLICKED(IDC_BUTTON_ADD, OnButtonAdd)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// Cpage3 message handlers
BOOL Cpage3::OnInitDialog()
{
CPropertyPage::OnInitDialog();
// TODO: Add extra initialization here
m_list.InsertColumn(0,"¼Ç ¼",LVCFMT_LEFT,150);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void Cpage3::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
}