问题描述
如何从另一个过程(计时器)调用一个过程(button_click)?
How do I call one procedure (button_click) from another procedure (timer)?
推荐答案
继承 System.Windows.Forms.Form
Inherits System.Windows.Forms.Form
# 区域 "Windows窗体设计器生成的代码"
#Region " Windows Form Designer generated code "
# 结束 区域
#End Region
私有 子 Timer1_Tick( ByVal 发送者 为 System.Object, ByVal e As System.EventArgs) 句柄 Timer1.Tick
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
致电 Button1_Click(发送者,e)
结束 Sub
End Sub
私人 Sub Button1_Click( ByVal 发送者 为 System.Object, ByVal e As System.Even tArgs) 句柄 Button1.Click
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MsgBox("Hello world")
MsgBox("Hello world")
结束 子
End Sub
结束 类
End Class
这篇关于呼叫程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!