control array

  • Thread starter Thread starter shachar
  • Start date Start date
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?
 
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.
 
shachar,

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

Cor
 
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.
 
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
 
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)
///
 
Back
Top