Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim i As Integer
i = 0
If TextBox1.Text <> "" Then i = i + 1
If Val(TextBox1.Text) > 0 Then i = i + 1
If Val(TextBox1.Text) < 100 Then i = i + 1
If TextBox1.Text = "" Then
MsgBox("Введите число")
End If
If Val(TextBox1.Text) < 0 Then
MsgBox("МЕНЬШЕ НУЛЯ, ХИТРЕЦ")
End If
If Val(TextBox1.Text) > 100 Then
MsgBox("Куда так много?! не больше 100!")
End If
If RadioButton1.Checked = False And RadioButton2.Checked = False And RadioButton3.Checked = False Then
MsgBox("УРОВЕНЬ ВЫБЕРИ")
End If
If RadioButton1.Checked = True Then
End If
Dim Therandom As New Random
If i = 3 Then
If RadioButton1.Checked = True Then
If TextBox1.Text > 10 Then
MsgBox("Число не должно быть больше 10")
ElseIf TextBox1.Text < 11 Then
Label1.Visible = False
Label2.Visible = False
Label3.Visible = False
Label1.Text = Therandom.Next(1, 10)
If TextBox1.Text = Label1.Text Then
Label1.Visible = True
Label2.Visible = True
Label3.Visible = True
Label3.Text = "YOU ARE CORRECT!!"
Button1.Enabled = False
TextBox1.Enabled = False
Else
Label1.Visible = True
Label2.Visible = True
Label3.Visible = True
Label3.Text = "YOU LOSE!!"
Button1.Enabled = False
TextBox1.Enabled = False
End If
End If
ElseIf RadioButton2.Checked = True Then
If TextBox1.Text > 50 Then
MsgBox("Число не должно быть больше 50")
ElseIf TextBox1.Text < 51 Then
Label1.Visible = False
Label2.Visible = False
Label3.Visible = False
Label1.Text = Therandom.Next(1, 50)
If TextBox1.Text = Label1.Text Then
Label1.Visible = True
Label2.Visible = True
Label3.Visible = True
Label3.Text = "YOU ARE CORRECT!!"
Button1.Enabled = False
TextBox1.Enabled = False
Else
Label1.Visible = True
Label2.Visible = True
Label3.Visible = True
Label3.Text = "YOU LOSE!!"
Button1.Enabled = False
TextBox1.Enabled = False
End If
End If
ElseIf RadioButton3.Checked = True Then
If TextBox1.Text > 100 Then
MsgBox("Число не должно быть больше 100")
ElseIf TextBox1.Text < 101 Then
Label1.Visible = False
Label2.Visible = False
Label3.Visible = False
Label1.Text = Therandom.Next(1, 100)
If TextBox1.Text = Label1.Text Then
Label1.Visible = True
Label2.Visible = True
Label3.Visible = True
Label3.Text = "YOU ARE CORRECT!!"
Button1.Enabled = False
TextBox1.Enabled = False
Else
Label1.Visible = True
Label2.Visible = True
Label3.Visible = True
Label3.Text = "YOU LOSE!!"
Button1.Enabled = False
TextBox1.Enabled = False
End If
End If
End If
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
TextBox1.Enabled = True
Button1.Enabled = True
End Sub
End Class