【老若】VB.net質問スレ【男女】 (Part3)
■ このスレッドは過去ログ倉庫に格納されています
0178デフォルトの名無しさん
NGNGまず、親フォームにタイマーを追加する
親フォームのタイマーの参照を、子フォームの WithEvents に代入する
親側
Private child As Form2
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
child = New Form2
child.Timer1 = Me.Timer1
Me.Timer1.Interval = 2000
Me.Timer1.Enabled = True
child.MdiParent = Me
child.Show()
End Sub
子側
Friend WithEvents Timer1 As System.Windows.Forms.Timer
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
MsgBox("child timer events")
End Sub
■ このスレッドは過去ログ倉庫に格納されています