|
不記得哪里的例子了. 可測試事件發生的先后,對理解事件觸發挺有好處
可將Me改為 forms("你的窗體名") 測試任何窗體
Function setEvent()
Dim p As Property
For Each p In Me.Properties
If Left(p.Name, 2) = "On" _
Or Left(p.Name, 5) = "After" _
Or Left(p.Name, 6) = "Before" Then
p.Value = "=msgbox('" & p.Name & "')"
End If
Next p
End Function
Function resumeEvent()
Dim p As Property
For Each p In Me.Properties
If Left(p.Name, 2) = "On" _
Or Left(p.Name, 5) = "After" _
Or Left(p.Name, 6) = "Before" Then
p.Value = ""
End If
Next p
End Function
|
|