I am a student currently and I am quite new to C#, I am currently working on a school project to create a game but I am facing a PictureBox
stacking problem. PictureBox
that I initialize first are at the front, and all other PictureBox
I initialize are behind it, it looks something like this,
Is there anyway that I can bring the photo up? this is how my code looks like.
handCardString = new List<string>();
handCardString = h.displayHand();
handCards = new PictureBox[99];
int q = 0;
int loca1 = 439;
foreach (string s in handCardString)
{
handCards[q] = new PictureBox();
String r = String.Format("c:/Users/youhj/Desktop/CA1/Cards/{0}.jpg",s);
Image ph = Image.FromFile(@r);
handCards[q].Image = ph;
pCardPhoto.Add(handCards[q]);
pCardPhoto[q].Location = new System.Drawing.Point(loca1, 383);
pCardPhoto[q].Size = new System.Drawing.Size(100, 126);
pCardPhoto[q].SizeMode = PictureBoxSizeMode.StretchImage;
pCardPhoto[q].BorderStyle = BorderStyle.None;
this.Controls.Add(pCardPhoto[q]);
loca1 += 20;
q++;
}