Start timer to another form RRS feed

  • Question

  • Unable to start timer to another form.

    Both form (form1 and form2) running same at the  time, 

    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click

    Timer1.Enable = True

          Dim f As New Form
            f = form2

    End Sub

    than form1 timer1 start and after 20 sec I want start form2.timer2 from form1.

    Private Sub Timer1_Elapsed(sender As System.Object, e As System.Timers.ElapsedEventArgs) Handles Timer1.Elapsed
    form2.timer2.enable = true

    End Sub

    but nothing start,,any help please

    Saturday, March 30, 2019 9:07 AM

All replies

  • Hi,

    try the code:

    Public Class Form1
        Dim f2 As New Form2
        Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
            Timer1.Enabled = True
        End Sub
        Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
            f2.Timer2.Enabled = True
        End Sub
    End Class

    Best Regards,


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact

    Saturday, March 30, 2019 9:34 AM