[RESOLVED] Create label in one sub, destory in another?
When the form first loads there are two global variables (assigned values in the form load sub as a default) that set the number of days back in time and how many days ahead events will be displayed (in an array of labels). If the user wants to view more events (or less events) the number of labels displayed (and the text they contain) will change. I have one sub (code below)that creates an array of labels.
What I can't seem to do is find a way to blow them off the form and "re-instantiate" as many as I need for the new user selectable range.
Code:
Private Sub CreateDisplayLabels()
Dim lblEvent(1000) As Label
Dim I As Integer
For I = 0 To DisplayCounter - 1
lblEvent(I) = New Label
With lblEvent(I)
.Name = CStr(I)
:
:
End With
Me.Controls.Add(lblEvent(I))
AddHandler lblEvent(I).Click, AddressOf Label_Click
Next I
End Sub
Any and all ideas are welcome and appreciated.
Re: Create label in one sub, destory in another?
Sorry. It never fails: It is only after I post a problem do I get things working.