MyMFC(7-9)对话框 CProp2

来源:互联网 发布:ubuntu tensorflow 编辑:程序博客网 时间:2024/06/05 19:05
// Prop2.cpp : 实现文件//#include "stdafx.h"#include "MyMFC2-Dialog.h"#include "Prop2.h"#include "afxdialogex.h"// CProp2 对话框IMPLEMENT_DYNAMIC(CProp2, CPropertyPage)CProp2::CProp2(): CPropertyPage(CProp2::IDD), m_football(FALSE), m_basketball(FALSE), m_swim(FALSE), m_bedmintain(FALSE){}CProp2::~CProp2(){}void CProp2::DoDataExchange(CDataExchange* pDX){CPropertyPage::DoDataExchange(pDX);DDX_Check(pDX, IDC_CHECK1, m_football);DDX_Check(pDX, IDC_CHECK2, m_basketball);DDX_Check(pDX, IDC_CHECK3, m_swim);DDX_Check(pDX, IDC_CHECK4, m_bedmintain);}BEGIN_MESSAGE_MAP(CProp2, CPropertyPage)END_MESSAGE_MAP()// CProp2 消息处理程序BOOL CProp2::OnSetActive()  //右击添加虚函数来实现的{// TODO:  在此添加专用代码和/或调用基类((CPropertySheet*)GetParent())->SetWizardButtons(PSWIZB_NEXT | PSWIZB_BACK);  //在第二个属性页上面“上一步”“下一步”按钮可用  //(必须在第二个属性页中也要设置,因为在第一个属性页中设置了,所以就不会再调用默认的了)return CPropertyPage::OnSetActive();}LRESULT CProp2::OnWizardNext(){// TODO:  在此添加专用代码和/或调用基类//在第一个属性页中的Radio Button按钮,可以设置一个Group,这样关联一个成员变量即可,因为只能够选择一个。但是,在Check Box的按钮是可以选择多个的。//所以要为每个按钮都关联一个成员变量,类别为Value,类型为BOOLUpdateData();if (m_football || m_basketball || m_swim || m_bedmintain)return CPropertyPage::OnWizardNext();else{MessageBox(_T("请选择你的兴趣爱好"));return -1;}//return CPropertyPage::OnWizardNext();}

0 0
原创粉丝点击