具有readonly属性的propertygrid和uitypeeditor设置不灰色! [英] propertygrid with readonly properties and uitypeeditor set not grey!

查看:205
本文介绍了具有readonly属性的propertygrid和uitypeeditor设置不灰色!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

希望有人遇到并解决了这个问题。



我有一个带有一组只读属性的propertygrid。



不使用自定义uitype编辑器的属性的属性名称显示为灰色或灰色。


指定了uitype编辑器的属性不会以这种方式显示。它们以正常的黑色文字显示。如果我注释掉编辑器属性,那么属性名称会变暗。



由于所有其他只读属性都是灰色,使自定义编辑器不是灰色的,给用户一种可编辑的印象。如果我在编辑器中更改了值,那么readonly属性将被认为是实际上没有更改该值。



这是正确的行为吗?如果有一种方法可以使用uitypeeditor设置显示只读属性灰色显示?



跟随另一个线程用户对可扩展对象属性有同样的问题,我尝试将我的typeconverter的CanConvertFrom更改为字符串返回true,但这不起作用。



谢谢,



Dan


< p align = left>


解决方案


我应该补充说我刚刚发现如果我设置 UITypeEditorEditStyle <字体大小= 2>下拉然后一切都变灰了。



我很遗憾地需要它是模态的....



我需要编辑器在readonly时显示,因为我将它用作长字符串属性的阅读器。




Hopefully someone has run into and solved this problem.

 

I have a propertygrid with a set of readonly properties.

 

Properties that do not use a custom uitype editor have their property names show up dimmed or grey'd out.

Properties that have a uitype editor specified do not show this way. They show in normal black text. If I comment out the editor attribute, then the property name dims out.

 

Since all the other readonly properties are grey, having the one with the custom editor not be grey gives the user the impression that it is editable. If I change the value in the editor, the readonly attribute is honored in that the value is not actually changed.

 

Is this the correct behavior? If there a way to make readonly properties with a uitypeeditor set appear grey'd out?

 

following another thread where the user had the same problem for expandable object properties, I have tried changing the CanConvertFrom of my typeconverter to return true for strings, but this does not work.

 

Thanks,

 

Dan

 

 

解决方案

 

I should add that I just found that if I set the UITypeEditorEditStyle to dropdown then everything goes grey.

 

I unfortunately need it to be modal....

 

I need the editor to show up when it is readonly because I am using it as a reader for long string properties.

 

 


这篇关于具有readonly属性的propertygrid和uitypeeditor设置不灰色!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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