MFC工控项目实例之十添加系统测试对话框

承接专栏《MFC工控项目实例之九选择下拉菜单主界面文本框显示菜单名》

参考前期我的博客文章《MFC3d立体按钮制作》

这里只给出相关代码

1、在SysTest.h文件中添加代码

cpp 复制代码
#include "ShadeButtonST.h"
#include "BtnST.h"
class CSysTest : public CDialog
{
// Construction
public:
	CSysTest(CWnd* pParent = NULL);   // standard constructor
	CShadeButtonST	m_SysTest,m_BoardTest,m_SensorTSet,m_Return;
	...
}	

2、在SEAL_PRESSUREDlg.cpp文件中添加代码

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 here
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

3、在SEAL_PRESSUREDlg.cpp文件中添加代码

cpp 复制代码
#include "SysTest.h"
void CSEAL_PRESSUREDlg::OnSysTest() 
{
	// TODO: Add your control notification handler code here
		CSysTest dlg;
    	dlg.DoModal();
}

运行程序

相关推荐
hPw0eKIqD7 小时前
C++ 模板参数推导问题小记(非推导上下文)
开发语言·c++
程序员爱德华8 小时前
Python与C++:异同点对比
c++·python
888CC++11 小时前
C语言与C++的区别:从面向过程到面向对象
java·c语言·c++
Darkwanderor12 小时前
Linux系统编程实战项目:模拟实现shell
linux·c++
himobrinehacken13 小时前
揭秘Windows程序启动的神秘之旅
c++·安全
库玛西13 小时前
C++ 运行时多态 :核心总结与原理图解
c语言·c++·笔记
Byron Loong14 小时前
【C++】重定向是什么
开发语言·c++
hansang_IR15 小时前
【题解】LC:Z 算法(Z Algorithm)
c++·算法·字符串
霍霍的袁17 小时前
【C++】模板从入门到进阶(函数模板 + 类模板 + 特化 + 分离编译)
开发语言·c++·visual studio
海清河晏11117 小时前
Qt 实战:信号与槽+事件系统
开发语言·c++·qt