Welcome to Dream.In.Code
Become a VB Expert!

Join 137,266 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,500 people online right now. Registration is fast and FREE... Join Now!




Hi GUYS

 
Reply to this topicStart new topic

Hi GUYS, eBlack Jack Game in VB.NET

Mr VB.NET
25 Nov, 2006 - 05:20 PM
Post #1

New D.I.C Head
*

Joined: 25 Nov, 2006
Posts: 1


My Contributions
"This is the card class I have created in the class
CODE
Public Class Card
    Private CardValue As Integer
    Private CardSuit As String

    Public Sub DealCard(ByVal val As Integer)
        Randomize()
        CardValue = Int(Rnd() * 52) + 1
        Select Case CardValue
            Case 1 To 13
                CardSuit = "Hearts"
            Case 14 To 26
                CardSuit = "Diamonds"
            Case 27 To 39
                CardSuit = "Clubs"
            Case 40 To 52
                CardSuit = "Spades"
        End Select
    End Sub
End Class

"This is the coding
CODE

Imports System.IO
Public Class Form1

    Private Sub btnDeal_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDeal.Click
        Dim Card1 As New Card
        Dim Card2 As New Card
        Card1.DealCard()
        Card2.DealCard()
    End Sub

    Private Sub btnWithdraw_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnWithdraw.Click
        If lblBank.Text > 0 Then
            lblMoney.Text = Val(lblMoney.Text) + 10
            lblBank.Text = Val(lblBank.Text) - 10
        End If
    End Sub

    Private Sub btnDeposit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDeposit.Click
        If lblMoney.Text > 0 Then
            lblMoney.Text = Val(lblMoney.Text) - 10
            lblBank.Text = Val(lblBank.Text) + 10
        End If
    End Sub

    Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
        Me.Close()
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    End Sub

    Private Sub btnHit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnHit.Click

    End Sub
End Class


edit: added [code] tags ~ jayman9
User is offlineProfile CardPM
+Quote Post

William_Wilson
RE: Hi GUYS
25 Nov, 2006 - 06:30 PM
Post #2

lost in compilation
Group Icon

Joined: 23 Dec, 2005
Posts: 4,013



Thanked: 18 times
Dream Kudos: 3275
Expert In: Java, C, Javascript

My Contributions
that's nice and all, but this is an introduction, put this question in the appropriate forum!

welcome to DIC! smile.gif

*also use [code ][ /code] tags around all code segments
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/4/08 07:30PM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month