C# Programming Challenge: Shuffle & Display Cards PART 1 (dynamically generate PictureBoxes)

preview_player
Показать описание
C# Programming Challenge: Shuffle and Display Cards in Picture Boxes (dynamically generating Form Controls) - PART 1

In this video we dynamically generate controls, add them to C# array of form objects, and display them on the form.

A button should shuffle the cards (randomize them) and deal out 40 cards so you can only see the left
edge of the card. There should be no duplicates in the dealt cards.

Note:
Since you have to add 40 card images to the form, I would strongly suggest
putting that in a loop. The only 2 statements that change are:
pictureBoxCard1.Image = myDeck.Cards[0].FaceImage;
pictureBoxCard1.Left = 50;
You should be able to calculate the left position based on the loop counter variable.

Learning to code? Follow my C# tutorials for beginners. I do a lot of C# programming challenges and C# projects as part of my homework - every day!
If you are learning to program, nothing beats solving real programming exercises and coding challenges.
So don't forget to subscribe, as I release several programming videos every week!

Рекомендации по теме
Комментарии
Автор

I see that this video was made in 2015. I was just wondering what version of visual studio you were using. I am using 2015 community and when I try to declare an array of pictureboxes[52] I am told that the compiler is incapable of implicitly converting type to

alephnot
join shbcf.ru