在 Visual Studio 中,为什么双击面板会产生绘画事件? (vb.net)

In Visual Studio why does a double click on a panel make a paint event? (vb.net)

我在 VS IDE 中,当我双击一个面板时,它会生成一个绘画事件而不是单击事件。我试过其他控件,它们工作正常。

此外,这种情况今天才开始发生。我知道我可以转到 properties/events 并双击 "click" 字段,它会产生所需的结果,但这很麻烦。

忘了说...我用的是 VS 2015

感谢任何帮助。

DefaultEventAttribute is used to specify the default event for a component. The docs for Panel (and presumably the other WinForms components) don't seem to show the value for the default event attribute, but if you look at the reference source(或者自己反编译),可以看到里面的值:

[
ComVisible(true),
ClassInterface(ClassInterfaceType.AutoDispatch),
DefaultProperty("BorderStyle"),
DefaultEvent("Paint"),
Docking(DockingBehavior.Ask),
Designer("System.Windows.Forms.Design.PanelDesigner, " + AssemblyRef.SystemDesign),
SRDescription(SR.DescriptionPanel)
]
public class Panel : ScrollableControl {

我想每个组件的设计者都选择最常用的事件作为默认事件,否则基础 Control class 定义默认值 Click:

[
ComVisible(true),
ClassInterface(ClassInterfaceType.AutoDispatch),
DefaultProperty("Text"),
DefaultEvent("Click"),
Designer("System.Windows.Forms.Design.ControlDesigner, " + AssemblyRef.SystemDesign),
DesignerSerializer("System.Windows.Forms.Design.ControlCodeDomSerializer, " + AssemblyRef.SystemDesign, "System.ComponentModel.Design.Serialization.CodeDomSerializer, " + AssemblyRef.SystemDesign),
ToolboxItemFilter("System.Windows.Forms")
]
public partial class Control :