i need to see the ClientRectangle of a form as i'm designing it. This particular property is tagged as "Advanced", and by default is hidden from the Properties window:
我需要看到表单的ClientRectangle,因为我正在设计它。此特定属性标记为“高级”,默认情况下从“属性”窗口隐藏:
[EditorBrowsable(EditorBrowsableState.Advanced), ...]
public Rectangle ClientRectangle
If the ClientRectangle
property i want to look at is out, then i guess i can settle for the advanced ClientSize
property:
如果我要查看的ClientRectangle属性已经出来,那么我想我可以满足于高级ClientSize属性:
[..., EditorBrowsable(EditorBrowsableState.Advanced)]
public Size ClientSize
The documentation for the EditorBrowsable attribute leads to an enumeration with 3 values:
EditorBrowsable属性的文档导致包含3个值的枚举:
Always The property or method is always browsable from within an editor.
始终在编辑器中始终可以浏览属性或方法。
Never The property or method is never browsable from within an editor.
从不在编辑器中浏览属性或方法。
Advanced The property or method is a feature that only advanced users should see. An editor can either show or hide such properties.
高级属性或方法是只有高级用户才能看到的功能。编辑器可以显示或隐藏此类属性。
Apparently i am an "advanced user", so how do tell Visual Studio that i am an advanced user so i can see the advanced properties?
显然我是一个“高级用户”,那么如何告诉Visual Studio我是一个高级用户,以便我可以看到高级属性?
Update One
The linked page talks about being able to enable Intellisense and the Properties Window to show advanced memebers:
链接页面讨论了能够启用Intellisense和属性窗口以显示高级成员:
In Visual C#, you can control when advanced properties appear in IntelliSense and the Properties Window with the Hide Advanced Members setting under Tools | Options | Text Editor | C#. The corresponding EditorBrowsableState is Advanced.
在Visual C#中,您可以在“工具”下的“智能感知”和“属性”窗口中使用“隐藏高级成员”设置控制何时显示高级属性选项|文字编辑器| C#。相应的EditorBrowsableState为Advanced。
Unfortunatly this option seems to, in reality, only apply to Intellisense. Having it unchecked does not make advanced properties visible in the Properties Window
不幸的是,这个选项实际上似乎只适用于Intellisense。取消选中它不会在“属性”窗口中显示高级属性
Note: the option is unchecked by default.
注意:默认情况下,该选项未选中。
2 个解决方案
#1
Hans Passant's answer at Finding and using hidden properties(such as DisplayRectangle) cleared this for me: it can't be done. The EditorBrowsable is only for the TEXT editor, and the attribute that controls the display in the Properties window is "Browsable(false)".
Hans Passant在Finding和使用隐藏属性(例如DisplayRectangle)的答案为我清除了这一点:它无法完成。 EditorBrowsable仅用于TEXT编辑器,控制“属性”窗口中显示的属性为“可浏览(false)”。
#2
The answer is in the link you provided:
答案在您提供的链接中:
In Visual C#, you can control when advanced properties appear in IntelliSense and the Properties Window with the Hide Advanced Members setting under Tools | Options | Text Editor | C#. The corresponding EditorBrowsableState is Advanced.
在Visual C#中,您可以在“工具”下的“智能感知”和“属性”窗口中使用“隐藏高级成员”设置控制何时显示高级属性选项|文字编辑器| C#。相应的EditorBrowsableState为Advanced。
#1
Hans Passant's answer at Finding and using hidden properties(such as DisplayRectangle) cleared this for me: it can't be done. The EditorBrowsable is only for the TEXT editor, and the attribute that controls the display in the Properties window is "Browsable(false)".
Hans Passant在Finding和使用隐藏属性(例如DisplayRectangle)的答案为我清除了这一点:它无法完成。 EditorBrowsable仅用于TEXT编辑器,控制“属性”窗口中显示的属性为“可浏览(false)”。
#2
The answer is in the link you provided:
答案在您提供的链接中:
In Visual C#, you can control when advanced properties appear in IntelliSense and the Properties Window with the Hide Advanced Members setting under Tools | Options | Text Editor | C#. The corresponding EditorBrowsableState is Advanced.
在Visual C#中,您可以在“工具”下的“智能感知”和“属性”窗口中使用“隐藏高级成员”设置控制何时显示高级属性选项|文字编辑器| C#。相应的EditorBrowsableState为Advanced。