0% found this document useful (0 votes)
35 views8 pages

Code

The document contains code for a quiz application with 15 multiple choice questions. It increments a button text value on each question to track progress. Checkboxes are used for answers, and checking the right or wrong answers triggers changing checkbox colors and enabling/disabling the next question button.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views8 pages

Code

The document contains code for a quiz application with 15 multiple choice questions. It increments a button text value on each question to track progress. Checkboxes are used for answers, and checking the right or wrong answers triggers changing checkbox colors and enabling/disabling the next question button.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Public Class Form1

Dim sapi
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
Button1.Text += 1
TextBox1.Text = ""
TextBox2.Text = ""

CheckBox1.Checked = False
CheckBox2.Checked = False
CheckBox3.Checked = False
CheckBox4.Checked = False

CheckBox1.Visible = True
CheckBox2.Visible = True
CheckBox3.Visible = True
CheckBox4.Visible = True

If Button1.Text = 1 Then
Call question1()
Button1.Enabled = False

End If

If Button1.Text = 2 Then
Call question2()
Button1.Enabled = False

End If

If Button1.Text = 3 Then
Call question3()
Button1.Enabled = False

End If

If Button1.Text = 4 Then
Call question4()
Button1.Enabled = False

End If

If Button1.Text = 5 Then
Call question5()
Button1.Enabled = False

End If

If Button1.Text = 6 Then
Call question6()
Button1.Enabled = False

End If

If Button1.Text = 7 Then
Call question7()
Button1.Enabled = False
End If

If Button1.Text = 8 Then
Call question8()
Button1.Enabled = False

End If

If Button1.Text = 9 Then
Call question9()
Button1.Enabled = False

End If

If Button1.Text = 10 Then
Call question10()
Button1.Enabled = False

End If

If Button1.Text = 11 Then
Call question11()
Button1.Enabled = False

End If

If Button1.Text = 12 Then
Call question12()
Button1.Enabled = False

End If

If Button1.Text = 13 Then
Call question13()
Button1.Enabled = False

End If

If Button1.Text = 14 Then
Call question14()
Button1.Enabled = False

End If

If Button1.Text = 15 Then
Call question15()
Button1.Enabled = False

End If

End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles MyBase.Load
Label1.Visible = True
CheckBox1.Visible = False
CheckBox2.Visible = False
CheckBox3.Visible = False
CheckBox4.Visible = False
End Sub

Private Sub question1()


Label1.Text = "sjgblkejbv"
CheckBox1.Text = "ajfbaks"
CheckBox2.Text = "ajfbaks"
CheckBox3.Text = "ajfbaks"
CheckBox4.Text = "ajfbaks"

If CheckBox1.Checked = True Then


Button1.Text += 1
End If
End Sub

Private Sub question2()


Label1.Text = "sjgblkejbv"
CheckBox1.Text = "ajfbaks"
CheckBox2.Text = "ajfbaks"
CheckBox3.Text = "ajfbaks"
CheckBox4.Text = "ajfbaks"

If CheckBox3.Checked = True Then


Button1.Text += 1
End If
End Sub

Private Sub question3()


Label1.Text = "sjgblkejbv"
CheckBox1.Text = "ajfbaks"
CheckBox2.Text = "ajfbaks"
CheckBox3.Text = "ajfbaks"
CheckBox4.Text = "ajfbaks"

If CheckBox1.Checked = True Then


Button1.Text += 1
End If
End Sub

Private Sub question4()


Label1.Text = "sjgblkejbv"
CheckBox1.Text = "ajfbaks"
CheckBox2.Text = "ajfbaks"
CheckBox3.Text = "ajfbaks"
CheckBox4.Text = "ajfbaks"

If CheckBox2.Checked = True Then


Button1.Text += 1
End If
End Sub

Private Sub question5()


Label1.Text = "sjgblkejbv"
CheckBox1.Text = "ajfbaks"
CheckBox2.Text = "ajfbaks"
CheckBox3.Text = "ajfbaks"
CheckBox4.Text = "ajfbaks"
If CheckBox3.Checked = True Then
Button1.Text += 1
End If
End Sub

Private Sub question6()


Label1.Text = "sjgblkejbv"
CheckBox1.Text = "ajfbaks"
CheckBox2.Text = "ajfbaks"
CheckBox3.Text = "ajfbaks"
CheckBox4.Text = "ajfbaks"

If CheckBox2.Checked = True Then


Button1.Text += 1
End If
End Sub

Private Sub question7()


Label1.Text = "sjgblkejbv"
CheckBox1.Text = "ajfbaks"
CheckBox2.Text = "ajfbaks"
CheckBox3.Text = "ajfbaks"
CheckBox4.Text = "ajfbaks"

If CheckBox2.Checked = True Then


Button1.Text += 1
End If
End Sub

Private Sub question8()


Label1.Text = "sjgblkejbv"
CheckBox1.Text = "ajfbaks"
CheckBox2.Text = "ajfbaks"
CheckBox3.Text = "ajfbaks"
CheckBox4.Text = "ajfbaks"

If CheckBox2.Checked = True Then


Button1.Text += 1
End If
End Sub

Private Sub question9()


Label1.Text = "sjgblkejbv"
CheckBox1.Text = "ajfbaks"
CheckBox2.Text = "ajfbaks"
CheckBox3.Text = "ajfbaks"
CheckBox4.Text = "ajfbaks"

If CheckBox2.Checked = True Then


Button1.Text += 1
End If
End Sub

Private Sub question10()


Label1.Text = "sjgblkejbv"
CheckBox1.Text = "ajfbaks"
CheckBox2.Text = "ajfbaks"
CheckBox3.Text = "ajfbaks"
CheckBox4.Text = "ajfbaks"

If CheckBox2.Checked = True Then


Button1.Text += 1
End If
End Sub

Private Sub question11()


Label1.Text = "sjgblkejbv"
CheckBox1.Text = "ajfbaks"
CheckBox2.Text = "ajfbaks"
CheckBox3.Text = "ajfbaks"
CheckBox4.Text = "ajfbaks"

If CheckBox1.Checked = True Then


Button1.Text += 1
End If
End Sub

Private Sub question12()


Label1.Text = "sjgblkejbv"
CheckBox1.Text = "ajfbaks"
CheckBox2.Text = "ajfbaks"
CheckBox3.Text = "ajfbaks"
CheckBox4.Text = "ajfbaks"

If CheckBox1.Checked = True Then


Button1.Text += 1
End If
End Sub

Private Sub question13()


Label1.Text = "sjgblkejbv"
CheckBox1.Text = "ajfbaks"
CheckBox2.Text = "ajfbaks"
CheckBox3.Text = "ajfbaks"
CheckBox4.Text = "ajfbaks"

If CheckBox3.Checked = True Then


Button1.Text += 1
End If
End Sub

Private Sub question14()


Label1.Text = "sjgblkejbv"
CheckBox1.Text = "ajfbaks"
CheckBox2.Text = "ajfbaks"
CheckBox3.Text = "ajfbaks"
CheckBox4.Text = "ajfbaks"

If CheckBox3.Checked = True Then


Button1.Text += 1
End If
End Sub

Private Sub question15()


Label1.Text = "sjgblkejbv"
CheckBox1.Text = "ajfbaks"
CheckBox2.Text = "ajfbaks"
CheckBox3.Text = "ajfbaks"
CheckBox4.Text = "ajfbaks"

If CheckBox3.Checked = True Then


Button1.Text += 1
End If
End Sub

Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles CheckBox1.CheckedChanged
If Button1.Text = 1 And CheckBox1.Checked = True Then
CheckBox1.BackColor = Color.Gold
Button1.Enabled = True
End If
If Button1.Text = 3 And CheckBox1.Checked = True Then
CheckBox1.BackColor = Color.Gold
Button1.Enabled = True
End If
If Button1.Text = 8 And CheckBox1.Checked = True Then
CheckBox1.BackColor = Color.Gold
Button1.Enabled = True
End If
If Button1.Text = 9 And CheckBox1.Checked = True Then
CheckBox1.BackColor = Color.Gold
Button1.Enabled = True
End If
' wrong answer
If Button1.Text = 2 And CheckBox1.Checked = True Then
CheckBox1.BackColor = Color.Red
Button1.Text = 0
PictureBox5.image =
Button1.Enabled = True
End If
If Button1.Text = 4 And CheckBox1.Checked = True Then
CheckBox1.BackColor = Color.Red
Button1.Text = 0
PictureBox5.Image =
Button1.Enabled = True
End If
If Button1.Text = 5 And CheckBox1.Checked = True Then
CheckBox1.BackColor = Color.Red
Button1.Text = 0
PictureBox5.Image =
Button1.Enabled = True
End If
If Button1.Text = 6 And CheckBox1.Checked = True Then
CheckBox1.BackColor = Color.Red
Button1.Text = 0
PictureBox5.Image =
Button1.Enabled = True
End If
If Button1.Text = 7 And CheckBox1.Checked = True Then
CheckBox1.BackColor = Color.Red
Button1.Text = 0
PictureBox5.Image =
Button1.Enabled = True
End If
If Button1.Text = 10 And CheckBox1.Checked = True Then
CheckBox1.BackColor = Color.Red
Button1.Text = 0
PictureBox5.Image =
Button1.Enabled = True
End If
If Button1.Text = 11 And CheckBox1.Checked = True Then
CheckBox1.BackColor = Color.Red
Button1.Text = 0
PictureBox5.Image =
Button1.Enabled = True
End If
If Button1.Text = 12 And CheckBox1.Checked = True Then
CheckBox1.BackColor = Color.Red
Button1.Text = 0
PictureBox5.Image =
Button1.Enabled = True
End If
If Button1.Text = 13 And CheckBox1.Checked = True Then
CheckBox1.BackColor = Color.Red
Button1.Text = 0
PictureBox5.Image =
Button1.Enabled = True
End If
If Button1.Text = 14 And CheckBox1.Checked = True Then
CheckBox1.BackColor = Color.Red
Button1.Text = 0
PictureBox5.Image =
Button1.Enabled = True
End If
If Button1.Text = 15 And CheckBox1.Checked = True Then
CheckBox1.BackColor = Color.Red
Button1.Text = 0
PictureBox5.Image =
Button1.Enabled = True
End If

End Sub

Private Sub CheckBox2_CheckedChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles CheckBox2.CheckedChanged
If Button1.Text = 1 And CheckBox2.Checked = True Then
CheckBox1.BackColor = Color.Gold
Button1.Enabled = True
End If
If Button1.Text = 2 And CheckBox2.Checked = True Then
CheckBox1.BackColor = Color.Gold
Button1.Enabled = True
End If
If Button1.Text = 3 And CheckBox2.Checked = True Then
CheckBox1.BackColor = Color.Gold
Button1.Enabled = True
End If
' wrong answers
If Button1.Text = 15 And CheckBox2.Checked = True Then
CheckBox1.BackColor = Color.Red
Button1.Text = 0
PictureBox5.Image =
Button1.Enabled = True
End If
End Sub
End Class

You might also like