|
-
Sep 20th, 2010, 10:25 PM
#1
Thread Starter
Addicted Member
[RESOLVED] Setting Labels in a Loop
Basically what i am doing is clicking on a picture in a Picture box and posting a label to the spot i click on. in some instances i will need to put as many as 60 labels on an individual picture. Below is a snippet of code that works perfectly fine to place 1 point.
What i would like to do is setup an array of labels. Something along the lines of
Dim i As Integer
i = 5
Dim Lab(i) As Label
then be able to loop through the code below until i get all my labels placed. The only issue is that when i try doing that i get an error that Label is a type and cannot be used as an expression.
Is there another way to do this that i am not seeing?
Below is the working code snippet
Label3.Parent = PictureBox1
Label3.Visible = True
Label3.BackColor = Color.Transparent
Label3.BringToFront()
Label3.ForeColor = Color.White
Label3.Text = "3"
Label3.Location = New Point(LocalMousePosition.X, LocalMousePosition.Y)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|