VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Its a powerball game!!!

by Jim Bob (1 Submission)
Category: Games
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Tue 2nd December 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Its a powerball game!!!

API Declarations


Dim kount As Single
Dim num1, num2, num3, num4, num5 As Integer
Dim Pb As Integer
Dim upot As Double

Rate Its a powerball game!!!



then put the labels in the circles
you will also need a command button
name it cmdplay
you will also have a another button 
name it cmddone

Private Sub cmddone_Click()
    End
End Sub

Private Sub cmdPlay_Click()
Shape1.FillColor = vbWhite
Shape2.FillColor = vbWhite
Shape3.FillColor = vbWhite
Shape4.FillColor = vbWhite
Shape5.FillColor = vbWhite
Shape6.FillColor = vbRed
Label1.BackColor = vbWhite
Label2.BackColor = vbWhite
Label3.BackColor = vbWhite
Label4.BackColor = vbWhite
Label5.BackColor = vbWhite
Label6.BackColor = vbRed
Label1.Visible = True
Label2.Visible = True
Label3.Visible = True
Label4.Visible = True
Label5.Visible = True
Label6.Visible = True
num1 = txt1.Text
num2 = txt2.Text
num3 = txt3.Text
num4 = txt4.Text
num5 = txt5.Text
Pb = txt6.Text
Randomize
    num1 = Int(Rnd * 45) + 1
    Label1.Caption = num1
    Do
    num2 = Int(Rnd * 45) + 1
    Loop Until num2 <> num1
    Do
    num3 = Int(Rnd * 45) + 1
    Loop Until num3 <> num2 And num3 <> num1
    Do
    num4 = Int(Rnd * 45) + 1
    Loop Until num4 <> num3 And num4 <> num2 And num4 <> num1
    Do
    num5 = Int(Rnd * 45) + 1
    Loop Until num5 <> num4 And num5 <> num3 And num5 <> num2 And num5 <> num1
    Label2.Caption = num2
    Label3.Caption = num3
    Label4.Caption = num4
    Label5.Caption = num5
Randomize
    Pb = Int(Rnd * 45) + 1
    Label6.Caption = Pb
    
    If txt1 = Label1 Then
    Shape1.FillColor = vbBlue
    Label1.BackColor = vbBlue
    End If
    
    If txt1 = Label2 Then
    Shape2.FillColor = vbBlue
    Label2.BackColor = vbBlue
    End If
    
    If txt1 = Label3 Then
    Shape3.FillColor = vbBlue
    Label3.BackColor = vbBlue
    End If
    
    If txt1 = Label4 Then
    Shape4.FillColor = vbBlue
    Label4.BackColor = vbBlue
    End If
    
    If txt1 = Label5 Then
    Shape5.FillColor = vbBlue
    Label5.BackColor = vbBlue
    End If
    
    If txt2 = Label2 Then
    Shape2.FillColor = vbBlue
    Label2.BackColor = vbBlue
    End If
    
    If txt2 = Label1 Then
    Shape1.FillColor = vbBlue
    Label1.BackColor = vbBlue
    End If
    
    If txt2 = Label3 Then
    Shape3.FillColor = vbBlue
    Label3.BackColor = vbBlue
    End If
    
    If txt2 = Label4 Then
    Shape4.FillColor = vbBlue
    Label4.BackColor = vbBlue
    End If
    
    If txt2 = Label5 Then
    Shape5.FillColor = vbBlue
    Label5.BackColor = vbBlue
    End If
    
    If txt3 = Label3 Then
    Shape3.FillColor = vbBlue
    Label3.BackColor = vbBlue
    End If
    
    If txt3 = Label2 Then
    Shape2.FillColor = vbBlue
    Label2.BackColor = vbBlue
    End If
    
    If txt3 = Label1 Then
    Shape1.FillColor = vbBlue
    Label1.BackColor = vbBlue
    End If
    
    If txt3 = Label4 Then
    Shape4.FillColor = vbBlue
    Label4.BackColor = vbBlue
    End If
    
    If txt3 = Label5 Then
    Shape5.FillColor = vbBlue
    Label5.BackColor = vbBlue
    End If
    
    If txt4 = Label4 Then
    Shape4.FillColor = vbBlue
    Label4.BackColor = vbBlue
    End If
    
    If txt4 = Label3 Then
    Shape3.FillColor = vbBlue
    Label3.BackColor = vbBlue
    End If
    
    If txt4 = Label2 Then
    Shape2.FillColor = vbBlue
    Label2.BackColor = vbBlue
    End If
    
    If txt4 = Label1 Then
    Shape1.FillColor = vbBlue
    Label1.BackColor = vbBlue
    End If
    
    If txt4 = Label5 Then
    Shape5.FillColor = vbBlue
    Label5.BackColor = vbBlue
    End If
    
    If txt5 = Label5 Then
    Shape5.FillColor = vbBlue
    Label5.BackColor = vbBlue
    End If
    
    If txt5 = Label4 Then
    Shape4.FillColor = vbBlue
    Label4.BackColor = vbBlue
    End If
    
    If txt5 = Label3 Then
    Shape3.FillColor = vbBlue
    Label3.BackColor = vbBlue
    End If
    
    If txt5 = Label2 Then
    Shape2.FillColor = vbBlue
    Label2.BackColor = vbBlue
    End If
    
    If txt5 = Label1 Then
    Shape1.FillColor = vbBlue
    Label1.BackColor = vbBlue
    End If
    
    If txt6 = Label6 Then
    Shape6.FillColor = vbGreen
    Label6.BackColor = vbGreen
    End If
     
    
        





End Sub

Private Sub Form_Load()
    Label1.Visible = False
    Label2.Visible = False
    Label3.Visible = False
    Label4.Visible = False
    Label5.Visible = False
    Label6.Visible = False
End Sub


Download this snippet    Add to My Saved Code

Its a powerball game!!! Comments

No comments have been posted about Its a powerball game!!!. Why not be the first to post a comment about Its a powerball game!!!.

Post your comment

Subject:
Message:
0/1000 characters