control array

S

shachar

hi all.
i want to add pictureBoxes dinamicly(control array) and i
wrote:
Dim pic as picturebox=new picturebox
Pic.visible=true
Pic.location=new point(100+I,200+I) 'I is a simple counter
Pic.name="Pic" & I
I+=1
Me.controls.add(pic)
BUT - i cant see any new picture box!
why?
 
H

Herfried K. Wagner [MVP]

shachar said:
i want to add pictureBoxes dinamicly(control array) and i
wrote:
Dim pic as picturebox=new picturebox
Pic.visible=true
Pic.location=new point(100+I,200+I) 'I is a simple counter
Pic.name="Pic" & I
I+=1
Me.controls.add(pic)
BUT - i cant see any new picture box!

Maybe the control has the same background color as the form, and thus is not
visible.
 
C

Cor Ligthert

shachar,

Probably because that you never see something when you add an empty
picturebox to a form.

Cor
 
G

Guest

clearly i wrote: pic.image=....
this is not the problem!
the problemis that the new PictureBox is hided behind the
big picturebox on the form.
how can i make it appeare on top of the big PictureBox?
i wrote: pic.BringToFront - BUT it didnt helped.
 
C

Cor Ligthert

Shachar,

I never know that with the Zorder comes first, however try to remove the
picturebox and add it on the end again.

me.controls.remove(thatbigpicturebox)
me.controls.add(thatbigpicturebox)

I hope this helps?

Cor
 
H

Herfried K. Wagner [MVP]

clearly i wrote: pic.image=....
this is not the problem!
the problemis that the new PictureBox is hided behind the
big picturebox on the form.
how can i make it appeare on top of the big PictureBox?
i wrote: pic.BringToFront - BUT it didnt helped.

Maybe you want to add the control to the picturebox...

\\\
Me.PictureBox1.Controls.Add(pic1)
///
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top