I have dynamically generated labels in my code. It is working fine. I want to change the position of those labels.
The above code will generate the labels. I am not able to move those labels. Any help will be helpful. I found some links that helps to move a label, but i want to move those dynamically generated labels.
Code:
Private Sub Form10_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Try Dim c As Integer = 10 Dim l As Integer = 0 Dim lft As Integer = 20 For i = 1 To c For j = 1 To 8 If l < c Then labelDemo = New Windows.Forms.Label labelDemo.Name = "label" labelDemo.Text = "Move" labelDemo.Left = lft labelDemo.AutoSize = True labelDemo.BackColor = Drawing.Color.Aquamarine Me.Controls.Add(labelDemo) l = l + 1 lft = lft + 80 End If Next Next Me.ResumeLayout() Catch ex As Exception End Try End Sub
Comment