本文主要是介绍MFC工控项目实例之十添加系统测试对话框,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
承接专栏《MFC工控项目实例之九选择下拉菜单主界面文本框显示菜单名》
参考前期我的博客文章《MFC3d立体按钮制作》
这里只给出相关代码
1、在SysTest.h文件中添加代码
#include "ShadeButtonST.h"
#include "BtnST.h"
class CSysTest : public CDialog
{
// Construction
public:CSysTest(CWnd* pParent = NULL); // standard constructorCShadeButtonST m_SysTest,m_BoardTest,m_SensorTSet,m_Return;...
}
2、在SEAL_PRESSUREDlg.cpp文件中添加代码
void CSysTest::DoDataExchange(CDataExchange* pDX)
{CDialog::DoDataExchange(pDX);//{{AFX_DATA_MAP(CSysTest)// NOTE: the ClassWizard will add DDX and DDV calls here
DDX_Control(pDX, IDC_BUTTON_SysTest, m_SysTest);
DDX_Control(pDX, IDC_BUTTON_BoardTest, m_BoardTest);
DDX_Control(pDX, IDC_BUTTON_SensorTSet, m_SensorTSet);
DDX_Control(pDX, IDC_BUTTON_Return, m_Return);//}}AFX_DATA_MAP
}BOOL CSysTest::OnInitDialog()
{CDialog::OnInitDialog();m_SysTest.SetShade(CShadeButtonST::SHS_HARDBUMP);m_BoardTest.SetShade(CShadeButtonST::SHS_HARDBUMP);m_SensorTSet.SetShade(CShadeButtonST::SHS_HARDBUMP);m_Return.SetShade(CShadeButtonST::SHS_HARDBUMP);// TODO: Add extra initialization herereturn TRUE; // return TRUE unless you set the focus to a control// EXCEPTION: OCX Property Pages should return FALSE
}
3、在SEAL_PRESSUREDlg.cpp文件中添加代码
#include "SysTest.h"
void CSEAL_PRESSUREDlg::OnSysTest()
{// TODO: Add your control notification handler code hereCSysTest dlg;dlg.DoModal();
}
运行程序
这篇关于MFC工控项目实例之十添加系统测试对话框的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!