Public Class Form1 Dim c1, c2, c3, c4, c5 As Integer Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Randomize() c1 = Int(Rnd() * 52) + 1 c2 = Int(Rnd() * 52) + 1 c3 = Int(Rnd() * 52) + 1 c4 = Int(Rnd() * 52) + 1 c5 = Int(Rnd() * 52) + 1 showCard1() ShowCard2() Showcard3() ShowCard4() ShowCard5() End Sub Private Sub showCard1() 'Clubs If c1 = 1 Then card1.Image = Image.FromFile("ac.png") End If If c1 = 2 Then card1.Image = Image.FromFile("2c.png") End If If c1 = 3 Then card1.Image = Image.FromFile("3c.png") End If If c1 = 4 Then card1.Image = Image.FromFile("4c.png") End If If c1 = 5 Then card1.Image = Image.FromFile("5c.png") End If If c1 = 6 Then card1.Image = Image.FromFile("6c.png") End If If c1 = 7 Then card1.Image = Image.FromFile("7c.png") End If If c1 = 8 Then card1.Image = Image.FromFile("8c.png") End If If c1 = 9 Then card1.Image = Image.FromFile("9c.png") End If If c1 = 10 Then card1.Image = Image.FromFile("10c.png") End If If c1 = 11 Then card1.Image = Image.FromFile("jc.png") End If If c1 = 12 Then card1.Image = Image.FromFile("qc.png") End If If c1 = 13 Then card1.Image = Image.FromFile("kc.png") End If 'Diamonds If c1 = 14 Then card1.Image = Image.FromFile("ad.png") End If If c1 = 15 Then card1.Image = Image.FromFile("2d.png") End If If c1 = 16 Then card1.Image = Image.FromFile("3d.png") End If If c1 = 17 Then card1.Image = Image.FromFile("4d.png") End If If c1 = 18 Then card1.Image = Image.FromFile("5d.png") End If If c1 = 19 Then card1.Image = Image.FromFile("6d.png") End If If c1 = 20 Then card1.Image = Image.FromFile("7d.png") End If If c1 = 21 Then card1.Image = Image.FromFile("8d.png") End If If c1 = 22 Then card1.Image = Image.FromFile("9d.png") End If If c1 = 23 Then card1.Image = Image.FromFile("10d.png") End If If c1 = 24 Then card1.Image = Image.FromFile("jd.png") End If If c1 = 25 Then card1.Image = Image.FromFile("qd.png") End If If c1 = 26 Then card1.Image = Image.FromFile("kd.png") End If 'Hearts If c1 = 27 Then card1.Image = Image.FromFile("ah.png") End If If c1 = 28 Then card1.Image = Image.FromFile("2h.png") End If If c1 = 29 Then card1.Image = Image.FromFile("3h.png") End If If c1 = 30 Then card1.Image = Image.FromFile("4h.png") End If If c1 = 31 Then card1.Image = Image.FromFile("5h.png") End If If c1 = 32 Then card1.Image = Image.FromFile("6h.png") End If If c1 = 33 Then card1.Image = Image.FromFile("7h.png") End If If c1 = 34 Then card1.Image = Image.FromFile("8h.png") End If If c1 = 35 Then card1.Image = Image.FromFile("9h.png") End If If c1 = 36 Then card1.Image = Image.FromFile("10h.png") End If If c1 = 37 Then card1.Image = Image.FromFile("jh.png") End If If c1 = 38 Then card1.Image = Image.FromFile("qh.png") End If If c1 = 39 Then card1.Image = Image.FromFile("kh.png") End If 'Spades If c1 = 40 Then card1.Image = Image.FromFile("as.png") End If If c1 = 41 Then card1.Image = Image.FromFile("2s.png") End If If c1 = 42 Then card1.Image = Image.FromFile("3s.png") End If If c1 = 43 Then card1.Image = Image.FromFile("4s.png") End If If c1 = 44 Then card1.Image = Image.FromFile("5s.png") End If If c1 = 45 Then card1.Image = Image.FromFile("6s.png") End If If c1 = 46 Then card1.Image = Image.FromFile("7s.png") End If If c1 = 47 Then card1.Image = Image.FromFile("8s.png") End If If c1 = 48 Then card1.Image = Image.FromFile("9s.png") End If If c1 = 49 Then card1.Image = Image.FromFile("10s.png") End If If c1 = 50 Then card1.Image = Image.FromFile("js.png") End If If c1 = 51 Then card1.Image = Image.FromFile("qs.png") End If If c1 = 52 Then card1.Image = Image.FromFile("ks.png") End If End Sub Private Sub ShowCard2() 'Clubs If c2 = 1 Then card2.Image = Image.FromFile("ac.png") End If If c2 = 2 Then card2.Image = Image.FromFile("2c.png") End If If c2 = 3 Then card2.Image = Image.FromFile("3c.png") End If If c2 = 4 Then card2.Image = Image.FromFile("4c.png") End If If c2 = 5 Then card2.Image = Image.FromFile("5c.png") End If If c2 = 6 Then card2.Image = Image.FromFile("6c.png") End If If c2 = 7 Then card2.Image = Image.FromFile("7c.png") End If If c2 = 8 Then card2.Image = Image.FromFile("8c.png") End If If c2 = 9 Then card2.Image = Image.FromFile("9c.png") End If If c2 = 10 Then card2.Image = Image.FromFile("10c.png") End If If c2 = 11 Then card2.Image = Image.FromFile("jc.png") End If If c2 = 12 Then card2.Image = Image.FromFile("qc.png") End If If c2 = 13 Then card2.Image = Image.FromFile("kc.png") End If 'Diamonds If c2 = 14 Then card2.Image = Image.FromFile("ad.png") End If If c2 = 15 Then card2.Image = Image.FromFile("2d.png") End If If c2 = 16 Then card2.Image = Image.FromFile("3d.png") End If If c2 = 17 Then card2.Image = Image.FromFile("4d.png") End If If c2 = 18 Then card2.Image = Image.FromFile("5d.png") End If If c2 = 19 Then card2.Image = Image.FromFile("6d.png") End If If c2 = 20 Then card2.Image = Image.FromFile("7d.png") End If If c2 = 21 Then card2.Image = Image.FromFile("8d.png") End If If c2 = 22 Then card2.Image = Image.FromFile("9d.png") End If If c2 = 23 Then card2.Image = Image.FromFile("10d.png") End If If c2 = 24 Then card2.Image = Image.FromFile("jd.png") End If If c2 = 25 Then card2.Image = Image.FromFile("qd.png") End If If c2 = 26 Then card2.Image = Image.FromFile("kd.png") End If 'Hearts If c2 = 27 Then card2.Image = Image.FromFile("ah.png") End If If c2 = 28 Then card2.Image = Image.FromFile("2h.png") End If If c2 = 29 Then card2.Image = Image.FromFile("3h.png") End If If c2 = 30 Then card2.Image = Image.FromFile("4h.png") End If If c2 = 31 Then card2.Image = Image.FromFile("5h.png") End If If c2 = 32 Then card2.Image = Image.FromFile("6h.png") End If If c2 = 33 Then card2.Image = Image.FromFile("7h.png") End If If c2 = 34 Then card2.Image = Image.FromFile("8h.png") End If If c2 = 35 Then card2.Image = Image.FromFile("9h.png") End If If c2 = 36 Then card2.Image = Image.FromFile("10h.png") End If If c2 = 37 Then card2.Image = Image.FromFile("jh.png") End If If c2 = 38 Then card2.Image = Image.FromFile("qh.png") End If If c2 = 39 Then card2.Image = Image.FromFile("kh.png") End If 'Spades If c2 = 40 Then card2.Image = Image.FromFile("as.png") End If If c2 = 41 Then card2.Image = Image.FromFile("2s.png") End If If c2 = 42 Then card2.Image = Image.FromFile("3s.png") End If If c2 = 43 Then card2.Image = Image.FromFile("4s.png") End If If c2 = 44 Then card2.Image = Image.FromFile("5s.png") End If If c2 = 45 Then card2.Image = Image.FromFile("6s.png") End If If c2 = 46 Then card2.Image = Image.FromFile("7s.png") End If If c2 = 47 Then card2.Image = Image.FromFile("8s.png") End If If c2 = 48 Then card2.Image = Image.FromFile("9s.png") End If If c2 = 49 Then card2.Image = Image.FromFile("10s.png") End If If c2 = 50 Then card2.Image = Image.FromFile("js.png") End If If c2 = 51 Then card2.Image = Image.FromFile("qs.png") End If If c2 = 52 Then card2.Image = Image.FromFile("ks.png") End If End Sub Private Sub Showcard3() 'Clubs If c3 = 1 Then card3.Image = Image.FromFile("ac.png") End If If c3 = 2 Then card3.Image = Image.FromFile("2c.png") End If If c3 = 3 Then card3.Image = Image.FromFile("3c.png") End If If c3 = 4 Then card3.Image = Image.FromFile("4c.png") End If If c3 = 5 Then card3.Image = Image.FromFile("5c.png") End If If c3 = 6 Then card3.Image = Image.FromFile("6c.png") End If If c3 = 7 Then card3.Image = Image.FromFile("7c.png") End If If c3 = 8 Then card3.Image = Image.FromFile("8c.png") End If If c3 = 9 Then card3.Image = Image.FromFile("9c.png") End If If c3 = 10 Then card3.Image = Image.FromFile("10c.png") End If If c3 = 11 Then card3.Image = Image.FromFile("jc.png") End If If c3 = 12 Then card3.Image = Image.FromFile("qc.png") End If If c3 = 13 Then card3.Image = Image.FromFile("kc.png") End If 'Diamonds If c3 = 14 Then card3.Image = Image.FromFile("ad.png") End If If c3 = 15 Then card3.Image = Image.FromFile("2d.png") End If If c3 = 16 Then card3.Image = Image.FromFile("3d.png") End If If c3 = 17 Then card3.Image = Image.FromFile("4d.png") End If If c3 = 18 Then card3.Image = Image.FromFile("5d.png") End If If c3 = 19 Then card3.Image = Image.FromFile("6d.png") End If If c3 = 20 Then card3.Image = Image.FromFile("7d.png") End If If c3 = 21 Then card3.Image = Image.FromFile("8d.png") End If If c3 = 22 Then card3.Image = Image.FromFile("9d.png") End If If c3 = 23 Then card3.Image = Image.FromFile("10d.png") End If If c3 = 24 Then card3.Image = Image.FromFile("jd.png") End If If c3 = 25 Then card3.Image = Image.FromFile("qd.png") End If If c3 = 26 Then card3.Image = Image.FromFile("kd.png") End If 'Hearts If c3 = 27 Then card3.Image = Image.FromFile("ah.png") End If If c3 = 28 Then card3.Image = Image.FromFile("2h.png") End If If c3 = 29 Then card3.Image = Image.FromFile("3h.png") End If If c3 = 30 Then card3.Image = Image.FromFile("4h.png") End If If c3 = 31 Then card3.Image = Image.FromFile("5h.png") End If If c3 = 32 Then card3.Image = Image.FromFile("6h.png") End If If c3 = 33 Then card3.Image = Image.FromFile("7h.png") End If If c3 = 34 Then card3.Image = Image.FromFile("8h.png") End If If c3 = 35 Then card3.Image = Image.FromFile("9h.png") End If If c3 = 36 Then card3.Image = Image.FromFile("10h.png") End If If c3 = 37 Then card3.Image = Image.FromFile("jh.png") End If If c3 = 38 Then card3.Image = Image.FromFile("qh.png") End If If c3 = 39 Then card3.Image = Image.FromFile("kh.png") End If 'Spades If c3 = 40 Then card3.Image = Image.FromFile("as.png") End If If c3 = 41 Then card3.Image = Image.FromFile("2s.png") End If If c3 = 42 Then card3.Image = Image.FromFile("3s.png") End If If c3 = 43 Then card3.Image = Image.FromFile("4s.png") End If If c3 = 44 Then card3.Image = Image.FromFile("5s.png") End If If c3 = 45 Then card3.Image = Image.FromFile("6s.png") End If If c3 = 46 Then card3.Image = Image.FromFile("7s.png") End If If c3 = 47 Then card3.Image = Image.FromFile("8s.png") End If If c3 = 48 Then card3.Image = Image.FromFile("9s.png") End If If c3 = 49 Then card3.Image = Image.FromFile("10s.png") End If If c3 = 50 Then card3.Image = Image.FromFile("js.png") End If If c3 = 51 Then card3.Image = Image.FromFile("qs.png") End If If c3 = 52 Then card3.Image = Image.FromFile("ks.png") End If End Sub Private Sub ShowCard4() If c4 = 1 Then card4.Image = Image.FromFile("ac.png") End If If c4 = 2 Then card4.Image = Image.FromFile("2c.png") End If If c4 = 3 Then card4.Image = Image.FromFile("3c.png") End If If c4 = 4 Then card4.Image = Image.FromFile("4c.png") End If If c4 = 5 Then card4.Image = Image.FromFile("5c.png") End If If c4 = 6 Then card4.Image = Image.FromFile("6c.png") End If If c4 = 7 Then card4.Image = Image.FromFile("7c.png") End If If c4 = 8 Then card4.Image = Image.FromFile("8c.png") End If If c4 = 9 Then card4.Image = Image.FromFile("9c.png") End If If c4 = 10 Then card4.Image = Image.FromFile("10c.png") End If If c4 = 11 Then card4.Image = Image.FromFile("jc.png") End If If c4 = 12 Then card4.Image = Image.FromFile("qc.png") End If If c4 = 13 Then card4.Image = Image.FromFile("kc.png") End If 'Diamonds If c4 = 14 Then card4.Image = Image.FromFile("ad.png") End If If c4 = 15 Then card4.Image = Image.FromFile("2d.png") End If If c4 = 16 Then card4.Image = Image.FromFile("3d.png") End If If c4 = 17 Then card4.Image = Image.FromFile("4d.png") End If If c4 = 18 Then card4.Image = Image.FromFile("5d.png") End If If c4 = 19 Then card4.Image = Image.FromFile("6d.png") End If If c4 = 20 Then card4.Image = Image.FromFile("7d.png") End If If c4 = 21 Then card4.Image = Image.FromFile("8d.png") End If If c4 = 22 Then card4.Image = Image.FromFile("9d.png") End If If c4 = 23 Then card4.Image = Image.FromFile("10d.png") End If If c4 = 24 Then card4.Image = Image.FromFile("jd.png") End If If c4 = 25 Then card4.Image = Image.FromFile("qd.png") End If If c4 = 26 Then card4.Image = Image.FromFile("kd.png") End If 'Hearts If c4 = 27 Then card4.Image = Image.FromFile("ah.png") End If If c4 = 28 Then card4.Image = Image.FromFile("2h.png") End If If c4 = 29 Then card4.Image = Image.FromFile("3h.png") End If If c4 = 30 Then card4.Image = Image.FromFile("4h.png") End If If c4 = 31 Then card4.Image = Image.FromFile("5h.png") End If If c4 = 32 Then card4.Image = Image.FromFile("6h.png") End If If c4 = 33 Then card4.Image = Image.FromFile("7h.png") End If If c4 = 34 Then card4.Image = Image.FromFile("8h.png") End If If c4 = 35 Then card4.Image = Image.FromFile("9h.png") End If If c4 = 36 Then card4.Image = Image.FromFile("10h.png") End If If c4 = 37 Then card4.Image = Image.FromFile("jh.png") End If If c4 = 38 Then card4.Image = Image.FromFile("qh.png") End If If c4 = 39 Then card4.Image = Image.FromFile("kh.png") End If 'Spades If c4 = 40 Then card4.Image = Image.FromFile("as.png") End If If c4 = 41 Then card4.Image = Image.FromFile("2s.png") End If If c4 = 42 Then card4.Image = Image.FromFile("3s.png") End If If c4 = 43 Then card4.Image = Image.FromFile("4s.png") End If If c4 = 44 Then card4.Image = Image.FromFile("5s.png") End If If c4 = 45 Then card4.Image = Image.FromFile("6s.png") End If If c4 = 46 Then card4.Image = Image.FromFile("7s.png") End If If c4 = 47 Then card4.Image = Image.FromFile("8s.png") End If If c4 = 48 Then card4.Image = Image.FromFile("9s.png") End If If c4 = 49 Then card4.Image = Image.FromFile("10s.png") End If If c4 = 50 Then card4.Image = Image.FromFile("js.png") End If If c4 = 51 Then card4.Image = Image.FromFile("qs.png") End If If c4 = 52 Then card4.Image = Image.FromFile("ks.png") End If End Sub Private Sub ShowCard5() 'Clubs If c5 = 1 Then card5.Image = Image.FromFile("ac.png") End If If c5 = 2 Then card5.Image = Image.FromFile("2c.png") End If If c5 = 3 Then card5.Image = Image.FromFile("3c.png") End If If c5 = 4 Then card5.Image = Image.FromFile("4c.png") End If If c5 = 5 Then card5.Image = Image.FromFile("5c.png") End If If c5 = 6 Then card5.Image = Image.FromFile("6c.png") End If If c5 = 7 Then card5.Image = Image.FromFile("7c.png") End If If c5 = 8 Then card5.Image = Image.FromFile("8c.png") End If If c5 = 9 Then card5.Image = Image.FromFile("9c.png") End If If c5 = 10 Then card5.Image = Image.FromFile("10c.png") End If If c5 = 11 Then card5.Image = Image.FromFile("jc.png") End If If c5 = 12 Then card5.Image = Image.FromFile("qc.png") End If If c5 = 13 Then card5.Image = Image.FromFile("kc.png") End If 'Diamonds If c5 = 14 Then card5.Image = Image.FromFile("ad.png") End If If c5 = 15 Then card5.Image = Image.FromFile("2d.png") End If If c5 = 16 Then card5.Image = Image.FromFile("3d.png") End If If c5 = 17 Then card5.Image = Image.FromFile("4d.png") End If If c5 = 18 Then card5.Image = Image.FromFile("5d.png") End If If c5 = 19 Then card5.Image = Image.FromFile("6d.png") End If If c5 = 20 Then card5.Image = Image.FromFile("7d.png") End If If c5 = 21 Then card5.Image = Image.FromFile("8d.png") End If If c5 = 22 Then card5.Image = Image.FromFile("9d.png") End If If c5 = 23 Then card5.Image = Image.FromFile("10d.png") End If If c5 = 24 Then card5.Image = Image.FromFile("jd.png") End If If c5 = 25 Then card5.Image = Image.FromFile("qd.png") End If If c5 = 26 Then card5.Image = Image.FromFile("kd.png") End If 'Hearts If c5 = 27 Then card5.Image = Image.FromFile("ah.png") End If If c5 = 28 Then card5.Image = Image.FromFile("2h.png") End If If c5 = 29 Then card5.Image = Image.FromFile("3h.png") End If If c5 = 30 Then card5.Image = Image.FromFile("4h.png") End If If c5 = 31 Then card5.Image = Image.FromFile("5h.png") End If If c5 = 32 Then card5.Image = Image.FromFile("6h.png") End If If c5 = 33 Then card5.Image = Image.FromFile("7h.png") End If If c5 = 34 Then card5.Image = Image.FromFile("8h.png") End If If c5 = 35 Then card5.Image = Image.FromFile("9h.png") End If If c5 = 36 Then card5.Image = Image.FromFile("10h.png") End If If c5 = 37 Then card5.Image = Image.FromFile("jh.png") End If If c5 = 38 Then card5.Image = Image.FromFile("qh.png") End If If c5 = 39 Then card5.Image = Image.FromFile("kh.png") End If 'Spades If c5 = 40 Then card5.Image = Image.FromFile("as.png") End If If c5 = 41 Then card5.Image = Image.FromFile("2s.png") End If If c5 = 42 Then card5.Image = Image.FromFile("3s.png") End If If c5 = 43 Then card5.Image = Image.FromFile("4s.png") End If If c5 = 44 Then card5.Image = Image.FromFile("5s.png") End If If c5 = 45 Then card5.Image = Image.FromFile("6s.png") End If If c5 = 46 Then card5.Image = Image.FromFile("7s.png") End If If c5 = 47 Then card5.Image = Image.FromFile("8s.png") End If If c5 = 48 Then card5.Image = Image.FromFile("9s.png") End If If c5 = 49 Then card5.Image = Image.FromFile("10s.png") End If If c5 = 50 Then card5.Image = Image.FromFile("js.png") End If If c5 = 51 Then card5.Image = Image.FromFile("qs.png") End If If c5 = 52 Then card5.Image = Image.FromFile("ks.png") End If End Sub End Class