Escolar Documentos
Profissional Documentos
Cultura Documentos
Dim CasePicked As Integer ' case selected by user, not his own
Dim pickcount As Integer ' keeps track of number of cases left to pick
Dim bCount As Integer ' keeps track of number of amounts still showing
Dim PM(26) 'randomized number list used for prize money index
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal
wMsg As Long, ByVal wParam As Integer, ByVal lParam As Long) As Long
End Sub
Dim x As Integer
PriceArray(0) = ".01"
PriceArray(1) = "1"
PriceArray(2) = "5"
PriceArray(3) = "10"
PriceArray(4) = "25"
PriceArray(5) = "50"
PriceArray(6) = "75"
PriceArray(7) = "100"
PriceArray(8) = "200"
PriceArray(9) = "300"
PriceArray(10) = "400"
PriceArray(11) = "500"
PriceArray(12) = "750"
PriceArray(13) = "1000"
PriceArray(14) = "5000"
PriceArray(15) = "10000"
PriceArray(16) = "25000"
PriceArray(17) = "50000"
PriceArray(18) = "75000"
PriceArray(19) = "100000"
PriceArray(20) = "200000"
PriceArray(21) = "300000"
PriceArray(22) = "400000"
PriceArray(23) = "500000"
PriceArray(24) = "750000"
PriceArray(25) = "1000000"
'load the prize amounts into the windows
For x = 0 To 25
Else
End If
Next x
End Sub
Dim A(26)
Dim x As Integer
A(seq) = seq
Next seq
Randomize
For MainLoop = MaxNumber To 0 Step -1
A(ChosenNumber) = A(MainLoop)
Next MainLoop
End Sub
Dim x As Integer
MyCase = 0
CasePicked = 0
pickcount = 6
pc = 0
txtPrevOffer.Visible = False
NumOfCasesLeft = 26
lblSelectedNum.Visible = False
imgBriefCase(x).Visible = True
lblCaseNum(x).Visible = True
lblAmounts(x).Visible = True
lblCaseNum(x).Caption = x + 1
Next x
LoadAmtArray
LoadPrizeMoneyArray
SelectingMyCase = True
cmdStart.Visible = False
Picture2.BackColor = &HFF0000
Picture4.BackColor = &HFF0000
OT1.BackCol = &HFF0000
OT2.BackCol = &HFF0000
OT3.BackCol = &HFF0000
End Sub
Dim x As Integer
Display.Text = " Deal is " & Format(sum, "$#,##0") & " "
lblSelectedNum.Caption = lblAmounts(PM(MyCase)).Caption
For x = 0 To 25
End If
End If
Next x
cmdStart.Visible = True
cmdDeal.Visible = False
cmdNoDeal.Visible = False
txtPrevOffer.Visible = False
End Sub
Dim x As Integer
cmdDeal.Visible = False
cmdNoDeal.Visible = False
Offer.Enabled = False ' in case you press no deal button before timer is
finished
Display.Text = " You Won " & Format(lblAmounts(PM(MyCase)).Caption, "$#,##0.00") & " "
lblCaseNum(x).Caption = lblAmounts(PM(x)).Caption
End If
Next x
cmdStart.Visible = True
txtPrevOffer.Visible = False
Exit Sub
End If
If pickcount = 1 Then
Display.Text = " Pick " & pickcount & " Case "
Else
Display.Text = " Pick " & pickcount & " Cases "
End If
pickcount = pickcount - 1
Picture2.BackColor = &HFF0000
Picture4.BackColor = &HFF0000
OT1.BackCol = &HFF0000
OT2.BackCol = &HFF0000
OT3.BackCol = &HFF0000
txtPrevOffer.Visible = False
End Sub
DelayTimer.Enabled = False
Unload Me
End Sub
FormDrag Me
End Sub
Private Sub imgBriefCase_Click(Index As Integer) 'in case user clicks on image and not label
PickingCases Index
End Sub
Private Sub lblCaseNum_Click(Index As Integer) 'in case user clicks on label and not image
PickingCases Index
End Sub
imgSelectedCase.Visible = True
lblSelectedNum.Visible = True
lblSelectedNum.Caption = Index + 1
NumOfCasesLeft = NumOfCasesLeft - 1
pickcount = pickcount - 1
SelectingMyCase = False
Exit Sub
End If
If Index = MyCase Then Exit Sub 'if user clicks on selected case it will not disappear
End If
CasePicked = Index
Else
End If
If pickcount = 0 Then
Picture2.BackColor = vbRed
Picture4.BackColor = vbRed
OT1.BackCol = vbRed
OT2.BackCol = vbRed
OT3.BackCol = vbRed
Offer.Enabled = True
Exit Sub
End If
pickcount = pickcount - 1
End Sub
Dim x As Integer
For x = 0 To 25
lblAmounts(x).Visible = False
End If
Next x
imgBriefCase(CasePicked).Visible = False
lblCaseNum(CasePicked).Visible = False
NumOfCasesLeft = NumOfCasesLeft - 1
DelayTimer.Enabled = False
End Sub
txtPrevOffer.Visible = True
Offer.Enabled = False
End Sub
DelayTimer.Enabled = False
Unload Me
End Sub
Dim x As Integer
bCount = 0
sum = 0
For x = 0 To 25 ' just to make sure selected amounts are not showing in amounts
columns
lblAmounts(x).Visible = False
End If
End If
Next x
End If
Next x
' I'm using simple averaging for the math... nothing complicated, but seems to work okay
' round off the offer by removing the last three digits and replacing them with 000
End If
pc = pc + 1
cmdDeal.Visible = True
cmdNoDeal.Visible = True
End Sub
ReleaseCapture
End Sub
End Sub