Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hy,

 

How can I create a picturebox when the program is running? I tryed this but the picturebox didn't appear on my form. :

 

 

 

 

Public Sub Continue_Champ()
       Dim tempimage As New System.Windows.Forms.PictureBox
       tempimage.Location = New System.Drawing.Point(Me.Width / 2, Me.Height / 2)
       tempimage.Name = "Champ" & colone.Count
       tempimage.Size = New System.Drawing.Size(88, 32)
       tempimage.BackColor = System.Drawing.Color.FromArgb(CType(255, Byte), CType(128, Byte), CType(128, Byte))
       tempimage.show
End Sub

 

 

 

 

 

I also tryed a pictureboxarray but when I use pictureboxarray1.load(0) It say that :

 

There are no controls in this control array. loading an existing control requide an exiting control to clone

 

 

But I don't know what it mean.

 

 

 

Hope you can help me,

 

Thank you,

 

ComCrack

[ () /\/\ [ |\ /\ [ |<
  • 2 years later...
Posted

Pictureboxarray problem!

 

create a separate picturebox with any name such as "pic"

 

in da code window expand "windows form designer code"

 

en the " 'pic1 "section add these lines

 

" Me.pictureboxarray1.SetIndex(Me.pic1, CType(0, Short))"

 

then run it with ur normal code! u got ur box to clone...

  • Leaders
Posted
I would stay away from the PictureBoxArray class if at all possible. It is there strictly for compatability with VB6. The nearest appropriate .Net equivalent would be to create your own array and manually populate it, but if you only need one picture box, you hardly need an array.
[sIGPIC]e[/sIGPIC]

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...