form1.vb

来自「模拟彩票系统」· VB 代码 · 共 44 行

VB
44 行
字号

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Label1.Text = "中奖号码产生中……"
        Timer1.Enabled = True


        Button2.Enabled = True

        Button3.Enabled = False


    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Randomize()
        TextBox1.Text = Fix(Rnd() * 40) + 1
        TextBox2.Text = Fix(Rnd() * 40) + 1
        TextBox3.Text = Fix(Rnd() * 40) + 1
        TextBox4.Text = Fix(Rnd() * 40) + 1
        TextBox5.Text = Fix(Rnd() * 40) + 1


    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Static x As Integer = 0

        x = x + 1
        Button1.Enabled = True
        Button2.Enabled = False

        Button3.Enabled = True
        Timer1.Enabled = False
        Label1.Text = "第" & x & "期中奖号码是:"
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        End

    End Sub
End Class

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?