Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi all,

 

I need an urgent help regarding this.

 

this is my problem.

 

I am creating 10 dynamic picture boxes at run time like this.

-----------------------------------------------

 

Dim picturea As New PictureBox()

picturea.Size = New Size(100, 100)

Me.Controls.Add(picturea)

 

 

each of these 10 picture boxes has names Pic1,Pic2,Pic3,Pic4.... etc.

 

Now I want to know how to control these dynamically.

 

for example

 

Can I use a for loop like below to control this

 

for i=0 to 10

 

"pic" + i.left = 100

"pic" + i.right = 100

 

next

 

Please help me

 

 

thanks

 

donny

  • *Experts*
Posted
You could declare the picture boxes as an array.
Dim pic(9) As PictureBox '0-9 = 10 picture boxes
Dim i As Integer

For i = 0 to 9
 pic(i) = New PictureBox()
 pic(i).Left = 100
 pic(i).Top = 100
Next i

Something like that.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...