Results 1 to 3 of 3

Thread: timer in another form?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2003
    Posts
    91

    timer in another form?

    how do i modify a timer in another form? one form has a timer with interval set to 100. another form has a textbox and button. when u click the button it should change the interval of the other form

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Dec 2003
    Posts
    91
    hheeelllppp

  3. #3
    Hyperactive Member
    Join Date
    Mar 2004
    Location
    Prato - Tuscany - Italy
    Posts
    461
    Before you have to ensure that you can refer your second Form (the one with the Timer. I named its instance as 'F2') , if so, you can write:

    Private Sub BtnCambiaIntervallo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnCambiaIntervallo.Click
    F2.Timer1.Interval = Int16.Parse(Me.TextBox1.Text)
    End Sub

    It put the new interval in your Timer, using the value read in textbox1 (careful, you have to put some validation control of its value, it's only a quick example)
    Good job
    If problem is refering the second form, you have to remember to declare it as public in a module.
    Live long and prosper (Mr. Spock)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width