Public Class Form1
Public flag As Integer
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
BeginInvoke2:
flag += 1
Dim i, q As Integer
i = 1
Dim a1() As Integer
Randomize()
ReDim a1(i)
Button1.BackColor = Color.DeepPink
If flag = 1 Then
Button1.Text = "停止"
GoTo BeginInvoke
ElseIf flag = 2 Then
Button1.Text = "抽成绩"
ElseIf flag = 3 Then
GoTo BeginInvoke1
Button1.Text = "停止"
ElseIf flag = 4 Then
Button1.Text = "重新开始"
flag = 0
i = 0
GoTo BeginInvoke2
End If
If i > 34 Then
Button1.Enabled = False
Button1.Text = "再怎么按也不能抽了!"
End If
BeginInvoke: While (flag <> 2)
BeginInvoke3: Label1.Text = Nothing
Label1.Text = "学号" & q
q = Int(Rnd() * 34 + 1)
PictureBox1.Image = Nothing
PictureBox1.Image = Image.FromFile("C:\Users\10753\Documents\Visual Studio 2015\Projects\WindowsApplication1\WindowsApplication1\obj\Debug\TempPE\" & q & ".jpg") '目前考虑到其他人装上这个程序没有图片源文件所以在找建立picture库
End While
i += 1
a1(i) = q '将循环结束的随机数保存到数组a1内
If a1(i) = q Then
GoTo BeginInvoke3
End If
BeginInvoke1: While (flag <> 4)
a1(i) = Int(Rnd() * 34 + 1)
Dim a3 As Integer
a3 = Int(Rnd() * 100 + 0)
Label2.Text = ""
Label2.Text = "成绩" + a3
End While
Public flag As Integer
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
BeginInvoke2:
flag += 1
Dim i, q As Integer
i = 1
Dim a1() As Integer
Randomize()
ReDim a1(i)
Button1.BackColor = Color.DeepPink
If flag = 1 Then
Button1.Text = "停止"
GoTo BeginInvoke
ElseIf flag = 2 Then
Button1.Text = "抽成绩"
ElseIf flag = 3 Then
GoTo BeginInvoke1
Button1.Text = "停止"
ElseIf flag = 4 Then
Button1.Text = "重新开始"
flag = 0
i = 0
GoTo BeginInvoke2
End If
If i > 34 Then
Button1.Enabled = False
Button1.Text = "再怎么按也不能抽了!"
End If
BeginInvoke: While (flag <> 2)
BeginInvoke3: Label1.Text = Nothing
Label1.Text = "学号" & q
q = Int(Rnd() * 34 + 1)
PictureBox1.Image = Nothing
PictureBox1.Image = Image.FromFile("C:\Users\10753\Documents\Visual Studio 2015\Projects\WindowsApplication1\WindowsApplication1\obj\Debug\TempPE\" & q & ".jpg") '目前考虑到其他人装上这个程序没有图片源文件所以在找建立picture库
End While
i += 1
a1(i) = q '将循环结束的随机数保存到数组a1内
If a1(i) = q Then
GoTo BeginInvoke3
End If
BeginInvoke1: While (flag <> 4)
a1(i) = Int(Rnd() * 34 + 1)
Dim a3 As Integer
a3 = Int(Rnd() * 100 + 0)
Label2.Text = ""
Label2.Text = "成绩" + a3
End While