带有多行编辑框的 CMFCPropertyGridProperty
如何使用编辑框创建多行属性?我还需要一个属性来在多行框中显示文本。
CMFCPropertyGridProperty* pGroup1 = new CMFCPropertyGridProperty(_T("Appearance"));
pGroup1->AddSubItem(new CMFCPropertyGridProperty(_T("Name"), (_variant_t) _T(""), _T("Specifies the text that will be displayed in the property")));
pGroup1->AddSubItem(new CMFCPropertyGridProperty(_T("Comments"), (_variant_t) _T(""), _T("Specifies the text that will be associated with the property")));
m_wndPropList.AddProperty(pGroup1);
How to create a multi line property with edit box? I need one more property that will show text in multi line box.
CMFCPropertyGridProperty* pGroup1 = new CMFCPropertyGridProperty(_T("Appearance"));
pGroup1->AddSubItem(new CMFCPropertyGridProperty(_T("Name"), (_variant_t) _T(""), _T("Specifies the text that will be displayed in the property")));
pGroup1->AddSubItem(new CMFCPropertyGridProperty(_T("Comments"), (_variant_t) _T(""), _T("Specifies the text that will be associated with the property")));
m_wndPropList.AddProperty(pGroup1);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
MFC Property Grid 中似乎没有实现多行属性。您可以使用按钮创建自定义属性,并在用户单击此按钮时使用多行编辑控件显示您自己的对话框。
It seems that multi-line properties are not implemented in MFC Property Grid. You can create a custom property with a button and show your own dialog with multi-line edit control when user click this button.
您可以像在旧式编辑器中一样执行此操作(替换“\n”、“\n”,以便用户可以用“\n”分隔行):
初始化:
读取值:
You can do it like in old style editors (replacing "\n","\n" so user can divide lines by "\n"):
Initialization:
Reading Value: