为什么 MouseClick 事件在 VB.net 中不起作用?

Why the MouseClick event doesn't work in VB.net?

我有这段代码:

Dim pointMove As New Point
Dim ukazovatko As Boolean = False
Private Sub Chart1_MouseMove(ByVal sender As Object, ByVal e As MouseEventArgs) Handles Chart1.MouseMove
    If ukazovatko Then
        pointMove = New Point(e.X, e.Y)
        Label1.Location = New Point(e.X + Label1.Size.Width / 2, Chart1.Bottom)
        Label1.Text = Math.Round(Chart1.ChartAreas(0).AxisX.PixelPositionToValue(e.X), 2)
    End If
End Sub
Private Sub Label1_Paint(ByVal sender As Object, ByVal e As PaintEventArgs) Handles Label1.Paint
    ControlPaint.DrawBorder(e.Graphics, Label1.DisplayRectangle, Color.Red, ButtonBorderStyle.Solid)
End Sub
Private Sub Chart1_MouseClick(ByVal sender As Object, ByVal e As MouseEventArgs) Handles Chart1.MouseClick
    ukazovatko = Not ukazovatko
End Sub
Private Sub Chart1_Paint(ByVal sender As Object, ByVal e As PaintEventArgs) Handles Chart1.Paint
    Chart1.Invalidate()
    Dim g As Graphics = e.Graphics
    Dim p As New Pen(Color.Red, 2)
    g.DrawLine(p, pointMove.X, 0, pointMove.X, Chart1.Size.Height)
End Sub

它在我的 test application. When I just copy-pasted the code into another application 中工作得很好,但它崩溃了。我发现它甚至无法识别 Chart.MouseClick 事件。我在想问题可能出在tabControl,但我不知道如何处理它。当然,在这个问题之前我已经做过研究,但似乎我是唯一遇到过此类问题的人 (:D)。另外我想提一下,我是编程初学者,所以我可能知道一些非常明显的解决方案。

最后,出于纯粹的绝望,我尝试重新组织代码,并将图表代码移到最底部,然后以某种方式修复了它。