I also have a need for this type of functionality, but on Web Forms
I have items that are variable in number that I wish to display on a web
form. And I would like to be able to specify or access the contents of
item(x) by referenced the x elements of that array/collection.
I have tried something like the following on the form load event but nothing
ever shows on the form.
Dim ArrLabel(10) As WebControls.Label
For x = 1 To 10
ArrLabel(x) = New WebControls.Label
ArrLabel(x).Visible = True
ArrLabel(x).Text = "Label "
Page.Controls.Add(ArrLabel(x))
Next
Any help or guidance is appreciated.
Fred
"ppap" <an*******@discussions.microsoft.com> wrote in message
news:18*****************************@phx.gbl...
-----Original Message-----
I try to make an array of label as this.
Dim ArrLabel(10) as System.Windows.Forms.Label
For i =0 to 10
ArrLabel(i) = New System.Windows.Forms.Label
ArrLabel(i).Left=25
ArrLabel(i).Top=25*i
ArrLabel(i).Name="Label" & i
ArrLabel(i).Text="Test" & i
ArrLabel(i).Show()
Next
But it didn't show on the form. Can you help me plz.
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
.You forgot to bind the label to a form .....
ArrLabel(i).Text="Test" & i
Me.Controls.Add(ArrLabel(i))
You don't need the Show Statement
............