我正在运行 Visual Studio 2010,也许它也适用于其他版本。当我在设计器中查看 RadioButton 的事件时,MouseDoubleClick 事件不存在:
但是,如果我转到代码 View 并查看那里的 RadioButton 事件,我可以看到 MouseDoubleClick 事件:
似乎 VS 设计器只显示继承的事件,而不是直接在 RadioButton 类中实现的事件。如何让所有这些都显示在设计器中?
编辑:正如 Hans Passant(对问题的评论)和 lomed(接受的答案)所指出的,这是有意隐藏的。我正在使用 ReSharper,这可能就是它出现在 IntelliSense 中的原因,lomed 在他接受的答案的评论中也指出了这一点。
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public event MouseEventHandler MouseDoubleClick;
最佳答案
使用 Object Browser
或在代码元数据中(右键单击 -> 转到定义或 F12)或 MSDN .
在 Object Browser
(F2) 中设置启用“显示隐藏类型和成员”(参见:Did you know… You can hide or show hidden members and types in the Object Browser? 和 Viewing the Structure of Code)
它隐藏您可以在他的签名
中看到的事件的方式:
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public event MouseEventHandler MouseDoubleClick;
关于c# - 如何让 Visual Studio 2010 显示 RadioButton 的所有可用事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24349513/