在 form_click 里写代码
Static dd As Integer
dd = dd + 1
text1 = "您点击了:" & dd & "次"
Public Class Form1
Public a As Integer'定义变量a为全局变量
Private Sub Form1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Click
a = a + 1
Label1.Text = "您单击窗体共 " & a & "次。"
End Sub
最简单的方法
在窗体的click事件中
a = a + 1
text1.text = a
Dim times As Integer
Private Sub Form_Load()
times = times + 1
Text1 = times
End Sub