简体   繁体   English

将自定义控件嵌入到CMFCPropertyGridCtrl属性项目

[英]Embed custom control to CMFCPropertyGridCtrl Property Item

I want to embed two generic buttons like "Select" and "Cancel" to CMFCPropertyGridCtrl property line. 我想在CMFCPropertyGridCtrl属性行中嵌入两个通用按钮,例如“选择”和“取消”。 Is there a painless way to do that? 有没有轻松的方法可以做到这一点?

Found a solution myself. 我自己找到了解决方案。 You can use OnCreateEditor virtual method to send a custom control to a property. 您可以使用OnCreateEditor虚拟方法将自定义控件发送到属性。 Note, that it will be shown on property edit. 注意,它将在属性编辑中显示。 Another important note, that CMFCPropertyGridCtrl calls OnCreateEditor each time the user edits the property but before the control is destroyed it deletes the last received CWnd object itself. 另一个重要说明是,每次用户编辑属性时, CMFCPropertyGridCtrl调用OnCreateEditor ,但是在销毁控件之前,它会删除最后收到的CWnd对象本身。 You should consider that. 您应该考虑一下。 I have found no notes about that in MSDN CMFCPropertyGridProperty documentation (you know what to say). 我没有在MSDN CMFCPropertyGridProperty文档中找到有关此说明的笔记(您知道该说些什么)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM