comcrack Posted July 30, 2003 Posted July 30, 2003 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 Quote [ () /\/\ [ |\ /\ [ |<
jorge Posted July 30, 2003 Posted July 30, 2003 Cant check don't have vb.net here at the moment try tempimage.show() Quote Jorge - http://www.blackdot.be/?page=apache.htm
*Experts* mutant Posted July 30, 2003 *Experts* Posted July 30, 2003 You need to add it to the form's control collection: Me.Controls.Add(tempimage) Quote
netmusket Posted July 30, 2006 Posted July 30, 2006 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... Quote
Leaders snarfblam Posted July 30, 2006 Leaders Posted July 30, 2006 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. Quote [sIGPIC]e[/sIGPIC]
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.