-- 作者:有点甜
-- 发布时间:2014/11/19 11:44:00
--
另一种思路:
全局代码
Public Sub btnOk_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) MessageBox.Show("这是自定义事件!") Tables("表A").AddNew Dim btnok As Windows.Forms.Button = sender removehandler btnok.Click, addressOf btnOk_Click End Sub
计划管理
Dim frm = Windows.Forms.Form.ActiveForm If frm IsNot Nothing AndAlso frm.Name = "Class122" Then Dim btnOk As Windows.Forms.Button = frm.Controls("btnOK") addhandler btnOk.Click, addressOf btnOk_Click MyTimers("计划1").Enabled = False End If
切换按钮
MyTimers("计划1").Enabled = True
|