VB6.0用掲示板の過去のログ(No.1)−VBレスキュー(花ちゃん)
[記事リスト] [新規投稿] [新着記事] [ワード検索] [過去ログ] [管理用]

投稿日: 2002/11/27(Wed) 11:01
投稿者NAO★
Eメール
URL
タイトルRe: スロットマシーン

試していないので動かないかもしれませんが、
こんな感じでしょうか?

Dim cnt As Integer
Dim STOP_FALG As Boolean    '回転を止めるフラグ
Private Sub cmdStart_Click()
    STOP_FALG = False    'フラグをリセット
    timTimer.Interval = 500    '通常の回転速度
    timTimer = True
End Sub

Private Sub cmdStop_Click()
    STOP_FALG = True    'フラグをセット
End Sub

Private Sub timTimer_Timer()
    picSlot(0).Picture = imgSlot(cnt).Picture
    picSlot(1).Picture = imgSlot(cnt + 1).Picture
    picSlot(2).Picture = imgSlot(cnt + 2).Picture
    cnt = cnt + 1
    If cnt = 8 Then
        cnt = 0
    End If

  Static osoi As Integer    'Static で宣言

    If STOP_FLAG = True then
        osoi = osoi + 1
    timTimer.Interval = timTimer.Interval + 500    'だんだん遅くする
        If osoi = 4 Then
           timTimer.Enabled = False
       osoi = 0    '次のためにリセット
        End If
    End If

End Sub


- 関連一覧ツリー (★ をクリックするとツリー全体を一括表示します)

- 返信フォーム (この記事に返信する場合は下記フォームから投稿して下さい)

- Web Forum -