MFC Feature Pack CMFCPropertyGridCtrl 控件的例子(动态创建 new)
来源:互联网 发布:centos 7 nat网络配置 编辑:程序博客网 时间:2024/05/08 20:00
MFC Feature Pack CMFCPropertyGridCtrl 控件的例子(动态创建 new)
南华大学
1. 在对话框头文件中声明以下几个公有(public)成员变量。
public:
virtual BOOL OnInitDialog();
public:
CMFCPropertyGridCtrl m_propertyGrid;
//
CMFCPropertyGridProperty* pGroup11;
CMFCPropertyGridProperty* pGroup12;
CMFCPropertyGridProperty* pGroup21;
//
2. 在对话框类实现文件的OnInitDialog函数中添加以下代码
CDialog::OnInitDialog();
// TODO: Add extra initialization here
CRect rectPropList;
GetClientRect(&rectPropList);
MapWindowPoints(this, &rectPropList);
//
m_propertyGrid.Create(WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_BORDER, rectPropList, this, (UINT)-1);
m_propertyGrid.EnableHeaderCtrl(TRUE, _T("属性"),_T("取值"));
m_propertyGrid.EnableDescriptionArea(TRUE);
//
m_propertyGrid.SetVSDotNetLook(TRUE);
m_propertyGrid.MarkModifiedProperties(TRUE);
m_propertyGrid.SetAlphabeticMode(FALSE);
m_propertyGrid.SetShowDragContext(TRUE);
//1
pGroup11 = new CMFCPropertyGridProperty(_T("输入重定向));
pGroup11->AddSubItem(new CMFCPropertyGridProperty(_T("子项目1"),
_T("25.36"), _T("This is a description")));
//
m_propertyGrid.AddProperty(pGroup11);
//2
pGroup12 = new CMFCPropertyGridProperty(_T("输出重定向"));
pGroup12->AddSubItem(new CMFCPropertyGridProperty(_T("子项目2"),
_T("25.36"), _T("This is a description")));
//
m_propertyGrid.AddProperty(pGroup12);
//3
pGroup21 = new CMFCPropertyGridProperty(_T("处理深度段"));
pGroup21->AddSubItem(new CMFCPropertyGridProperty(_T("起始深度"),_T("99.3"), _T("处理起始深度")));
pGroup21->AddSubItem(new CMFCPropertyGridProperty(_T("结束深度"),_T("99.4"), _T("处理结束深度")));
//
m_propertyGrid.AddProperty(pGroup21);
//
3.效果
4.获取用户输入值的方法
CMFCPropertyGridProperty *pProperty;//定义一个指向子项的指针
//输入重定向
pProperty=pGroup11->GetSubItem(0) ;//获得子项的指针
// pGroup11在对话框头文件中定义(公有成员变量)
const COleVariant &strValue=pProperty->GetValue();//获得子项值
CString strTmp =(CString)strValue;
MessageBox( strTmp);
- MFC Feature Pack CMFCPropertyGridCtrl 控件的例子(动态创建 new)
- MFC Feature Pack CMFCPropertyGridCtrl 控件的例子
- MFC Feature Pack CMFCPropertyGridCtrl控件的应用
- MFC Feature Pack CMFCPropertyGridCtrl控件的应用
- MFC Feature Pack发布
- MFC Feature Pack for Visual C++ 2008的BUG之一
- MFC Feature Pack for Visual C++ 2008的BUG之一
- mfc动态创建控件
- MFC动态创建控件
- MFC 动态创建控件
- MFC动态创建控件
- 动态创建mfc控件
- MFC 动态创建控件
- MFC动态创建控件的消息处理
- MFC动态创建控件的消息处理
- MFC动态创建控件的消息处理
- 控件的动态创建-MFC方式
- MFC 2008 feature pack 技巧点滴
- windows hook初步
- uboot 分析之 start.s
- 游戏术语大解析
- 计算机时间同步系统USB接口
- 修改Android开机第一屏方法
- MFC Feature Pack CMFCPropertyGridCtrl 控件的例子(动态创建 new)
- module的认识1
- JavaMail API详解
- 关于用VC++读取TIFF文件的源代码
- 什么是S-OFF(小白扫盲)
- 005.DNW烧写FL2440 NAND Flash分区
- 小白必看 APN/证书/越狱等名词详解
- File and directory.
- 怎么申请google map api-key