hi,
can somebody explain this problem? it's driving me crazy!
i have a requirement to dynamically create a variable quantity of timers
with associated start button based on the contents of a database. if i
create system timers dynamically, i cannot reference them from the start
button click event handler. the build error is ' <timer name> not
declared>
----
however, if i declare the system timers outside runtime code, everything
works fine! ....but that doesn't do me much good since i dont' know how
many timers i'll need at design time.
gotta be syntax or something. thanks in advance. kris
---- THIS WORKS -----
Public Class Form1
Inherits System.Windows.Forms.Form
Private t As New System.Timers.Timer 'TIMER DECLARED HERE
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'create start buttons
'add button click handlers
'add range button controls
End Sub
Public Sub btnStart(ByVal sender As Object, ByVal e As System.EventArgs)
t.Enabled = True
End Sub
---- DOES NOT BUILD ----
Public Class Form1
Inherits System.Windows.Forms.Form
'timer declaration added
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
dim t As New System.Timers.Timer 'TIMER DECLARED HERE
add elapsed time handler
'create start buttons
'add button click handlers
'add range button controls
End Sub
Public Sub btnStart(ByVal sender As Object, ByVal e As System.EventArgs)
t.Enabled = True !!!!!!! CAUSES BUILD ERROR (t not declared)
End Sub