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
Printable View
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
hheeelllppp
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.