propertygrid object with custom editor like a slider

我们两清 提交于 2020-01-16 03:38:54

问题


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.

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

do you have an idea to help me?


回答1:


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.



来源:https://stackoverflow.com/questions/22357101/propertygrid-object-with-custom-editor-like-a-slider

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!