带有自定义编辑器(如滑块)的 propertygrid 对象 [英] propertygrid object with custom editor like a slider

查看:26
本文介绍了带有自定义编辑器(如滑块)的 propertygrid 对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的 windowsForm 应用程序中,我使用 PropertyGrid 来编辑我的类的实例:其中一些属性是带有最大和最小项的浮点数.

In my windowsForm application I use a PropertyGrid to edit the instances of my class: some of these properties are floating point with maximum and minimum item.

我希望通过滑块或类似的东西来修改它们.

I wish modify them by a slider or something like it.

我发现了这个:http://www.visualhint.com/propertygrid 但不是免费..

I've found this: http://www.visualhint.com/propertygrid but is not free..

你有什么想法可以帮我吗?

do you have an idea to help me?

推荐答案

您可以使用 TrackBar.请注意,PropertyGrid 默认情况下不允许您向其中添加此类控件.所以,你需要在这里做一些工作.您将需要创建一个继承自 System.Drawing.Design.UITypeEditor 的类.接下来,您必须为必须将轨迹栏显示为控件的属性设置编辑器属性.请注意,除非您进行自定义绘制,否则它将显示为模态对话框或下拉编辑器.

You can make use of TrackBar. Note that PropertyGrid by default does not allow you to add controls like these to it. So, you will need to do some work here. You will need to create a class that inherits from System.Drawing.Design.UITypeEditor. Next you will have to set the editor attribute for the property that has to display track bar as control. Note that unless you do custom paint, it will be shown as modal dialog or as dropdown editor.

这篇关于带有自定义编辑器(如滑块)的 propertygrid 对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆