控制对象在属性网格中显示的内容 [英] Control What Displays in Property Grid for Object

查看:63
本文介绍了控制对象在属性网格中显示的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我确定这个存在,只是找不到,但是控制文本"的属性是什么呢?

就像,如果我要向我的类添加一个从组件继承的布尔属性,那么属性窗口允许我配置此布尔属性,但是我想要说是",和否"不是真实"和假".



我在作为DataColumn的对象中有一个属性.默认编辑器允许我从属性链接到数据集中的数据集中选择我想要的DataColumn,但是,一旦选中,该属性旁边会显示小号+,但是值窗口为空(空白).

< DefaultValue(CType(Nothing,DataColumn))&​​gt; _
公共属性SortColumn作为DataColumn
Get
end get
Set
End Set
End Property

当组件是首先将其放置在表单上,​​该属性将显示在属性Grid中,并在其旁边显示值(无).当我从数据集的表之一中选择一个数据列时,该字段将变为空白.我希望它在方括号中显示名称"列.

谢谢
Jaeden的"Sifo Dyas"吗? al'Raec Ruiner


永远不要信任计算机.您的大脑比任何芯片都聪明."

I'm sure this exists I just can't find it, but what is the attribute that controls the "text" that is shown in the property grid.

So Like, if I was adding a Boolean property to my class which is inherited from component, so the properties window allows me to configure this boolean property, but I want it to say "Yes" and "No" not "True" and "False". 

Or

I have a Property in an Object that is a DataColumn.  The default editor allows me to select which DataColumn I want from the dataset the property is linked to, however, once selected, the little + sign shows up next to the property, but the value window is empty (blank). 

<DefaultValue(CType(Nothing, DataColumn))> _
Public Property SortColumn as DataColumn
Get
end get
Set
End Set
End Property

When the Component is first dropped on the form the property is displayed in the property Grid with the value (none) next to it.  When I select a DataColumn from one of the tables in the DataSet, the field goes blank.  I'd like it to display the column Name in square brackets or something.  Is there an attribute or somethign that would allow me to affect this?

Thanks
Jaeden "Sifo Dyas" al'Raec Ruiner


"Never Trust a computer. Your brain is smarter than any micro-chip."

推荐答案

Jaeden,

您正在扩展Visual Studio吗?听起来像是
Hi Jaeden,

Are you extending the Visual Studio? it sounds like a .NET Base Class Library question.

Sincerely,
Wesley


这篇关于控制对象在属性网格中显示的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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