动态创建对话框方法

来源:互联网 发布:·手机淘宝 编辑:程序博客网 时间:2024/06/04 18:00

第一步:创建一个对话框控件;

第二步:给该对话框关联一个类(比如CTipsDlg );

第三步:CTipsDlg dlgTips;
dlgTips.Create(IDD_TIPS,this);
dlgTips.ShowWindow(TRUE);

CString strTips = L"要修改的界面字符串";
CWnd *pWndStatus = dlgTips.GetDlgItem(IDC_STATIC_TIPS);
//设置新的文字
pWndStatus->SetWindowText(strTips);
dlgTips.UpdateWindow(); 

0 0
原创粉丝点击