Hi.. I am using Vb 2008. I have created label array in run-time(Dynamically). I have put them in Panel1.
Some Labels are adding with location change. I have attached my project to your review!!!
Thank You
Supun Silva
VB.NET:
Dim loc As Integer
loc = 5
For i = 1 To 25
NewLabelMe(i) = New Label
NewLabelMe(i).Text = "99.99"
NewLabelMe(i).Size = New Point(65, 35)
'NewLabelMe(i).Location = New Point(5, loc)
NewLabelMe(i).Name = "NewLB" & i
Dim FontName As String = "Microsoft Sans Serif"
Dim FontSize As Integer = 14
Dim FS As New Font(FontName, FontSize, FontStyle.Bold)
NewLabelMe(i).Font = FS
NewLabelMe(i).TextAlign = ContentAlignment.TopCenter
NewLabelMe(i).BorderStyle = BorderStyle.Fixed3D
NewLabelMe(i).Parent = Panel1
NewLabelMe(i).BringToFront()
NewLabelMe(i).Anchor = AnchorStyles.Top
Panel1.Controls.Add(NewLabelMe(i))
NewLabelMe(i).Left = 5
NewLabelMe(i).Top = loc
AddHandler NewLabelMe(i).Click, AddressOf BtnExitOnClick
loc = loc + 36
Next
loc = 5
Some Labels are adding with location change. I have attached my project to your review!!!
Thank You
Supun Silva
Attachments
Last edited by a moderator: