Jump to content
Xtreme .Net Talk

Recommended Posts

  • *Experts*
Posted

Can you tell something more about what you are hardcoding?

To load a picture into a picturebox you can do this:

PictureBox1.Image = Image.FromFile("path to the file")

Posted

PictureBox1.Image = picimage(1)

PictureBox2.Image = picimage(2)

PictureBox3.Image = picimage(3)

PictureBox4.Image = picimage(4)

if i could make an array of the pictureboxes

i could loop it easy enough

Posted

i can make the array of pictureboxes in the code

i can put the pics in them

 

but my question is

how do i get them to show

without hard coding the the names

of the pictureboxes on the form?

Posted

You mean a sort of refresh that you need after the pic is loaded in the picturebox?

 

really strange what you are saying, in .net you can't have this kind of problems, i suggest you to have a list of Names of the pictures, and to load it in the form controls by the simple functions that the controls give you

live any day of your life like your last.
Posted

If you have an array of pictureboxes, and you want to show it on a form having almost for example Picturebox1 control ,

 

Picturebox1=pictureArray(1)

 

the game is done.

live any day of your life like your last.
  • *Experts*
Posted
Use Me.Controls.Add() to add a control to the form. Something like this:
'once you've set up all the PictureBoxes

Dim p As New PictureBox()
For Each p in pictureBoxArray
 Me.Controls.Add(p)
Next p

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