1、在主界面添加一个组合框和一个静态文本框。
2、在SEAL_PRESSUREDlg.cpp文件中添加代码
cpp
BOOL CSEAL_PRESSUREDlg::OnInitDialog()
{
CDialog::OnInitDialog();
...
GetDlgItem(IDC_STATIC_TYPNAME)->SetFont(&m_sFont);
...
}
void CSEAL_PRESSUREDlg::OnTypeChange(UINT nID)
{
theApp.m_nProductSel = nID - ID_DEF_PRODUCT+1;
CWinApp* pApp = AfxGetApp();
pApp->WriteProfileInt("参数","nProductSel1",theApp.m_nProductSel);
CString str = theApp.m_allPara[theApp.m_nProductSel].m_strTypeName;
SetDlgItemText(IDC_STATIC_TYPNAME,str);
}
运行程序