gpt4 book ai didi

c# - 如何让 Visual Studio 2010 显示 RadioButton 的所有可用事件

转载 作者:行者123 更新时间:2023-11-30 16:11:27 24 4
gpt4 key购买 nike

我正在运行 Visual Studio 2010,也许它也适用于其他版本。当我在设计器中查看 RadioButton 的事件时,MouseDoubleClick 事件不存在:

Visual Studio 2010 Designer Events

但是,如果我转到代码 View 并查看那里的 RadioButton 事件,我可以看到 MouseDoubleClick 事件:

enter image description here

似乎 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) RadioButton.MouseDobleClick in object explorer

它隐藏您可以在他的签名中看到的事件的方式:

[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public event MouseEventHandler MouseDoubleClick;

关于c# - 如何让 Visual Studio 2010 显示 RadioButton 的所有可用事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24349513/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com