-
Notifications
You must be signed in to change notification settings - Fork 0
/
Form4.vb
176 lines (162 loc) · 5.76 KB
/
Form4.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
Public Class Form4
Dim score As Integer
Dim isAllowed As Boolean = False
Sub New(ByVal sc As Integer)
' This call is required by the designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
score = sc
Label7.Text = score
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
Label5.Text = Label5.Text - 1
Label2.Text = Label2.Text - 500
If Label5.Text = 0 Then
Timer1.Stop()
MsgBox("Times Up")
PictureBox2.Enabled = False
PictureBox3.Enabled = False
PictureBox4.Enabled = False
PictureBox5.Enabled = False
PictureBox6.Enabled = False
PictureBox7.Enabled = False
PictureBox8.Enabled = False
PictureBox9.Enabled = False
isAllowed = True
End If
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Me.Close()
Form1.Close()
End Sub
Private Sub Form4_Load(sender As Object, e As EventArgs) Handles MyBase.Load
End Sub
Private Sub PictureBox5_Click(sender As Object, e As EventArgs) Handles PictureBox5.Click
Timer1.Enabled = False
Timer1.Stop()
PictureBox2.Enabled = False
PictureBox3.Enabled = False
PictureBox4.Enabled = False
PictureBox5.Enabled = False
PictureBox6.Enabled = False
PictureBox7.Enabled = False
PictureBox8.Enabled = False
PictureBox9.Enabled = False
isAllowed = True
Label7.Text = CInt(Label7.Text) + CInt(Label2.Text)
MsgBox("Right Choice!!")
End Sub
Private Sub PictureBox4_Click(sender As Object, e As EventArgs) Handles PictureBox4.Click
Timer1.Enabled = False
Timer1.Stop()
PictureBox2.Enabled = False
PictureBox3.Enabled = False
PictureBox4.Enabled = False
PictureBox5.Enabled = False
PictureBox6.Enabled = False
PictureBox7.Enabled = False
PictureBox8.Enabled = False
PictureBox9.Enabled = False
isAllowed = True
MsgBox("wrong Choice!!")
End Sub
Private Sub PictureBox2_Click(sender As Object, e As EventArgs) Handles PictureBox2.Click
Timer1.Enabled = False
Timer1.Stop()
PictureBox2.Enabled = False
PictureBox3.Enabled = False
PictureBox4.Enabled = False
PictureBox5.Enabled = False
PictureBox6.Enabled = False
PictureBox7.Enabled = False
PictureBox8.Enabled = False
PictureBox9.Enabled = False
isAllowed = True
MsgBox("wrong Choice!!")
End Sub
Private Sub PictureBox3_Click(sender As Object, e As EventArgs) Handles PictureBox3.Click
Timer1.Enabled = False
Timer1.Stop()
PictureBox2.Enabled = False
PictureBox3.Enabled = False
PictureBox4.Enabled = False
PictureBox5.Enabled = False
PictureBox6.Enabled = False
PictureBox7.Enabled = False
PictureBox8.Enabled = False
PictureBox9.Enabled = False
isAllowed = True
MsgBox("wrong Choice!!")
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim newForm As New Form5(Label7.Text)
newForm.Show()
Me.Close()
End Sub
Private Sub Form1_KeyPress(sender As Object, e As System.Windows.Forms.KeyPressEventArgs) Handles Me.KeyPress
If isAllowed Then
If e.KeyChar = ChrW(Keys.Enter) Then
Dim newForm As New Form5(Label7.Text)
newForm.Show()
Me.Close()
End If
End If
End Sub
Private Sub PictureBox6_Click(sender As Object, e As EventArgs) Handles PictureBox6.Click
Timer1.Enabled = False
Timer1.Stop()
PictureBox2.Enabled = False
PictureBox3.Enabled = False
PictureBox4.Enabled = False
PictureBox5.Enabled = False
PictureBox6.Enabled = False
PictureBox7.Enabled = False
PictureBox8.Enabled = False
PictureBox9.Enabled = False
isAllowed = True
MsgBox("wrong Choice!!")
End Sub
Private Sub PictureBox7_Click(sender As Object, e As EventArgs) Handles PictureBox7.Click
Timer1.Enabled = False
Timer1.Stop()
PictureBox2.Enabled = False
PictureBox3.Enabled = False
PictureBox4.Enabled = False
PictureBox5.Enabled = False
PictureBox6.Enabled = False
PictureBox7.Enabled = False
PictureBox8.Enabled = False
PictureBox9.Enabled = False
isAllowed = True
MsgBox("wrong Choice!!")
End Sub
Private Sub PictureBox8_Click(sender As Object, e As EventArgs) Handles PictureBox8.Click
Timer1.Enabled = False
Timer1.Stop()
PictureBox2.Enabled = False
PictureBox3.Enabled = False
PictureBox4.Enabled = False
PictureBox5.Enabled = False
PictureBox6.Enabled = False
PictureBox7.Enabled = False
PictureBox8.Enabled = False
PictureBox9.Enabled = False
isAllowed = True
MsgBox("wrong Choice!!")
End Sub
Private Sub PictureBox9_Click(sender As Object, e As EventArgs) Handles PictureBox9.Click
Timer1.Enabled = False
Timer1.Stop()
PictureBox2.Enabled = False
PictureBox3.Enabled = False
PictureBox4.Enabled = False
PictureBox5.Enabled = False
PictureBox6.Enabled = False
PictureBox7.Enabled = False
PictureBox8.Enabled = False
PictureBox9.Enabled = False
isAllowed = True
Label7.Text = CInt(Label7.Text) + CInt(Label2.Text)
MsgBox("Right Choice!!")
End Sub
End Class