' ' First - Embed all of the cards in the project ' ' Second - Create an Array of cards called Deck. ' ' Third - In Form_Load create an instance of each card in the deck ' ' For i = 0 To 54 ' Deck(i) = New Card ' Next ' ' Fourth - Call AssignDeck from Form_Load ' ' Sub AssignDeck() ' Some loop variables Dim i, j As Integer ' I don't want to type these values 4 times, so I will type them once ' and use this array 4 times. Dim cardrank(13) As String cardrank(1) = "Ace" cardrank(2) = "Two" cardrank(3) = "Three" cardrank(4) = "Four" cardrank(5) = "Five" cardrank(6) = "Six" cardrank(7) = "Seven" cardrank(8) = "Eight" cardrank(9) = "Nine" cardrank(10) = "Ten" cardrank(11) = "Jack" cardrank(12) = "Queen" cardrank(13) = "King" 'Spades For i = 1 To 13 ' j stores cards 1 - 13 j = i + 0 Deck(j).Back = My.Resources.Back5 Deck(j).Front = My.Resources.ResourceManager.GetObject("S" & i.ToString) Deck(j).RankValue = i Deck(j).SuitValue = 1 Deck(j).Suit = "Spades" Deck(j).Rank = cardrank(i) Next 'Diamonds For i = 1 To 13 ' j stores cards 14 - 26 j = i + 13 Deck(j).Back = My.Resources.Back5 Deck(j).Front = My.Resources.ResourceManager.GetObject("D" & i.ToString) Deck(j).RankValue = i Deck(j).SuitValue = 2 Deck(j).Suit = "Diamonds" Deck(j).Rank = cardrank(i) Next 'Clubs For i = 1 To 13 ' j stores cards 27 - 39 j = i + 26 Deck(j).Back = My.Resources.Back5 Deck(j).Front = My.Resources.ResourceManager.GetObject("C" & i.ToString) Deck(j).RankValue = i Deck(j).SuitValue = 3 Deck(j).Suit = "Clubs" Deck(j).Rank = cardrank(i) Next 'Hearts For i = 1 To 13 ' j stores cards 40 - 52 j = i + 39 Deck(j).Back = My.Resources.Back5 Deck(j).Front = My.Resources.ResourceManager.GetObject("H" & i.ToString) Deck(j).RankValue = i Deck(j).SuitValue = 4 Deck(j).Suit = "Hearts" Deck(j).Rank = cardrank(i) Next 'Red Joker Deck(53).Back = My.Resources.Back5 Deck(53).Front = My.Resources.Y1 Deck(53).RankValue = 0 Deck(53).SuitValue = 0 Deck(53).Suit = "Wild" Deck(53).Rank = "Joker" 'Black Joker Deck(54).Back = My.Resources.Back5 Deck(54).Front = My.Resources.Y2 Deck(54).RankValue = 0 Deck(54).SuitValue = 0 Deck(54).Suit = "Wild" Deck(54).Rank = "Joker" End Sub