预设一个整型全局变量:点击次数
窗口的AfterLoad:
Dim btn As WinForm.Button = e.Form.Controls("Button1")If Vars("点击次数") > 5 Then btn.Enabled =FalseEnd If
按钮的Click:
Dim btn As WinForm.Button = e.Form.Controls("Button1")If Vars("点击次数") < 6 Then
事件代码 Vars("点击次数") = Vars("点击次数") + 1Else btn.Enabled =FalseEnd If