i know this creates picturebox array
PictureBox[] choices = new PictureBox[4];
how do i do choices[0] = "C:\\Users\\*****\\Desktop\\New Folder\\pslots7.jpg";?
i know this creates picturebox array
PictureBox[] choices = new PictureBox[4];
how do i do choices[0] = "C:\\Users\\*****\\Desktop\\New Folder\\pslots7.jpg";?
From the MSDN documentation on PictureBox:
// Stretches the image to fit the pictureBox.
pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
MyImage = new Bitmap(fileToDisplay);
pictureBox1.ClientSize = new Size(xSize, ySize);
pictureBox1.Image = (Image) MyImage;
You can substitute pictureBox1 in the above example for choices[0] in your code. fileToDisplay is the string filepath. xSize and ySize are the dimensions of your image in pixels (both are int's).
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.