I have an 80 number keno game and on a win 2 labels rotate up to the amount won
at the same time a sound plays at the same time and the sound stops when the labels stop rotating.
This has worked in the past, but now the labels do not rotate until the sound has stopped.
i cannot determine why.
the code:
at the same time a sound plays at the same time and the sound stops when the labels stop rotating.
This has worked in the past, but now the labels do not rotate until the sound has stopped.
i cannot determine why.
the code:
Code:
Dim miCnt As Long' form level variable
Sub AddRunWinning(AmountWon As Currency)
mEndNum = AmountWon
miCnt = 1
Timer1.Interval = 60
Timer1.Enabled = True
'Play the ADDINGWINNINGS.wav file frome the resource file
sndData = LoadResData("ADDINGWINNINGS", "SOUND")
sndPlaySound sndData(0), SND_LOOP Or SND_ASYNC Or SND_MEMORY
End Sub
Private Sub Timer1_Timer()
Dim lblcreditcurrency As Currency
lblcreditcurrency = GetPriceByBetMode(mBetMode)
Debug.Print "miCnt " & miCnt
If miCnt <= mCreditsWon Then
lblWinThisRun.Caption = lblWinThisRun.Caption + 1
If mCreditMode = 1 Then' currency
lblCredit.Caption = CCur(lblCredit.Caption) + lblcreditcurrency
lblCredit.Caption = Format(lblCredit.Caption, "currency")
miCnt = miCnt + 1
Else
lblCredit.Caption = Val(lblCredit.Caption) + 1
miCnt = miCnt + 1
End If
Else
Timer1.Enabled = False
'Stop the Sound
sndPlaySound ByVal 0, 0
End If
End Sub
Private Function GetPriceByBetMode(ByVal betMode As Integer) As Double
Select Case betMode '1cent, 2cents etc
Case 0
GetPriceByBetMode = 0.01
Case 1
GetPriceByBetMode = 0.02
Case 2
GetPriceByBetMode = 0.05
Case 3
GetPriceByBetMode = 0.1
Case 4
GetPriceByBetMode = 0.25
End Select
End Function