I have a program that used information form treenodes and put them in the textbox after timer ticks
the problem is that i should use AddHandler for ticking, but i dont know how to refer to the title() and name() because they are not on the same sub private
note, this code does not have the full used codes
here I want to refer to the title and name from the above sub , what should I write??
the problem is that i should use AddHandler for ticking, but i dont know how to refer to the title() and name() because they are not on the same sub private
note, this code does not have the full used codes
VB.NET:
Private Sub myevents(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim i As Integer = 0
Dim title(i) As TextBox
title(i) = New TextBox
Dim name(i) As TextBox
name(i) = New TextBox
Dim timer(i) As Timer
timer(i) = New Timer
while i < 5
title(i) = New TextBox
name(i) = New TextBox
title(i).Text = titlestree.Nodes(i).Text
name(i).Text = nametree.Nodes(i).Text
timer(i) = New Timer
AddHandler timer(i).Tick, AddressOf aftertick
timer(i).Interval = 10000 * (i + 1)
timer(i).Enabled = True
i=i+1
End While
here I want to refer to the title and name from the above sub , what should I write??
VB.NET:
Private Sub aftertick(ByVal sender As System.Object, ByVal e As System.EventArgs)
'how can i do that?
[COLOR="Red"]textbox1.text=title(i).text
textbox2.text=name(i).text[/COLOR]
End Sub