Ho un form con un timer e un bottone. Il codice non mi segna erroe tranne che nell'event handler tick, sicuramente non ho importato qualkosa credo... mi potet aiutare?
codice:
Imports System.Timers.Timer
Public Class Form1
Inherits System.Windows.Forms.Form
.....
Private Sub InitializeTimer()
' Run this procedure in an appropriate event.
' Set to 1 second.
Timer1.Interval = 1000
' Enable timer.
Timer1.Enabled = True
Button1.Text = "Enabled"
End Sub
Private Sub Timer1_Tick(ByVal Sender As Object, ByVal e As EventArgs) Handles Timer1.Tick
' Quì a questo tick mi dà errore
' Set the caption to the current time.
Label1.Text = DateTime.Now
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If Button1.Text = "Stop" Then
Button1.Text = "Start"
Timer1.Enabled = False
Else
Button1.Text = "Stop"
Timer1.Enabled = True
End If
End Sub
End Class