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

Formulario 1: "Respuesta Correcta"

The document describes 12 forms that make up a quiz application. Each form displays a multiple choice question by loading data from a database table. Buttons on each form allow navigating between forms and checking answers, increasing a counter for correct answers. The forms pass data and control between each other to display the quiz questions sequentially and track the user's progress.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views12 pages

Formulario 1: "Respuesta Correcta"

The document describes 12 forms that make up a quiz application. Each form displays a multiple choice question by loading data from a database table. Buttons on each form allow navigating between forms and checking answers, increasing a counter for correct answers. The forms pass data and control between each other to display the quiz questions sequentially and track the user's progress.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 12

Formulario 1

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


Button1.Click
Form2.Show()
End Sub

Formulario 2

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click


If (RadioButton1.Checked Or RadioButton2.Checked) Then
If RadioButton1.Checked Then
MsgBox("Respuesta correcta")
c=c+1
End If
If RadioButton2.Checked Then
MsgBox("Respuesta incorrecta")
End If
End If
Form3.Show()
Me.Hide()
End Sub

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


MyBase.Load
Form1.Hide()
cn.Open()
Dim ConsultarDatos As String = "Select * From Preguntas "
Dim dataAdapter As New OleDb.OleDbDataAdapter(ConsultarDatos, cn)
dataAdapter.Fill(dt)
fila = 0
Label1.Text = CStr(dt.Rows(fila)("Preguntas"))
RadioButton1.Text = CStr(dt.Rows(fila)("Respuesta1"))
RadioButton2.Text = CStr(dt.Rows(fila)("Respuesta2"))
dataAdapter.Dispose()
cn.Close()

Formulario 3

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click


If (RadioButton1.Checked Or RadioButton2.Checked) Then
If RadioButton1.Checked Then
MsgBox("Respuesta correcta")
c=c+1
End If
If RadioButton2.Checked Then
MsgBox("Respuesta incorrecta")
End If
End If
Form4.Show()
Me.Hide()
End Sub

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


MyBase.Load
cn.Open()
Dim ConsultarDatos As String = "Select * From Preguntas "
Dim dataAdapter As New OleDb.OleDbDataAdapter(ConsultarDatos, cn)
dataAdapter.Fill(dt)
fila = 1
Label1.Text = CStr(dt.Rows(fila)("Preguntas"))
RadioButton1.Text = CStr(dt.Rows(fila)("Respuesta1"))
RadioButton2.Text = CStr(dt.Rows(fila)("Respuesta2"))
dataAdapter.Dispose()
cn.Close()
End Sub

Formulario 4

Private Sub Form4_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load


Form3.Hide()
cn.Open()
Dim ConsultarDatos As String = "Select * From Preguntas "
Dim dataAdapter As New OleDb.OleDbDataAdapter(ConsultarDatos, cn)
dataAdapter.Fill(dt)
fila = 2
Label1.Text = CStr(dt.Rows(fila)("Preguntas"))
RadioButton1.Text = CStr(dt.Rows(fila)("Respuesta1"))
RadioButton2.Text = CStr(dt.Rows(fila)("Respuesta2"))
dataAdapter.Dispose()
cn.Close()
End Sub

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


Button2.Click
If (RadioButton1.Checked Or RadioButton2.Checked) Then
If RadioButton2.Checked Then
MsgBox("Respuesta correcta")
c=c+1
End If
If RadioButton1.Checked Then
MsgBox("Respuesta incorrecta")
End If
End If
Form5.ShowDialog()
Me.Hide()
End Sub

Formulario 5

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


Button2.Click
If (RadioButton1.Checked Or RadioButton2.Checked) Then
If RadioButton2.Checked Then
MsgBox("Respuesta correcta")
c=c+1
End If
If RadioButton1.Checked Then
MsgBox("Respuesta incorrecta")
End If
End If
Form6.Show()
Me.Hide()
End Sub

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


MyBase.Load
cn.Open()
Dim ConsultarDatos As String = "Select * From Preguntas "
Dim dataAdapter As New OleDb.OleDbDataAdapter(ConsultarDatos, cn)
dataAdapter.Fill(dt)
fila = 3
Label1.Text = CStr(dt.Rows(fila)("Preguntas"))
RadioButton1.Text = CStr(dt.Rows(fila)("Respuesta1"))
RadioButton2.Text = CStr(dt.Rows(fila)("Respuesta2"))
dataAdapter.Dispose()
cn.Close()
End Sub

Formulario 6

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click


If (RadioButton1.Checked Or RadioButton2.Checked) Then
If RadioButton2.Checked Then
MsgBox("Respuesta correcta")
c=c+1
End If
If RadioButton1.Checked Then
MsgBox("Respuesta incorrecta")
End If
End If
Form7.Show()
Me.Hide()
End Sub

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


MyBase.Load
cn.Open()
Dim ConsultarDatos As String = "Select * From Preguntas "
Dim dataAdapter As New OleDb.OleDbDataAdapter(ConsultarDatos, cn)
dataAdapter.Fill(dt)
fila = 4
Label1.Text = CStr(dt.Rows(fila)("Preguntas"))
RadioButton1.Text = CStr(dt.Rows(fila)("Respuesta1"))
RadioButton2.Text = CStr(dt.Rows(fila)("Respuesta2"))
dataAdapter.Dispose()
cn.Close()
End Sub

Formulario 7
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If (RadioButton1.Checked Or RadioButton2.Checked) Then
If RadioButton1.Checked Then
MsgBox("Respuesta correcta")
c=c+1
End If
If RadioButton2.Checked Then
MsgBox("Respuesta incorrecta")
End If
End If
Form8.Show()
Me.Hide()
End Sub

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


MyBase.Load
cn.Open()
Dim ConsultarDatos As String = "Select * From Preguntas "
Dim dataAdapter As New OleDb.OleDbDataAdapter(ConsultarDatos, cn)
dataAdapter.Fill(dt)
fila = 5
Label1.Text = CStr(dt.Rows(fila)("Preguntas"))
RadioButton1.Text = CStr(dt.Rows(fila)("Respuesta1"))
RadioButton2.Text = CStr(dt.Rows(fila)("Respuesta2"))
dataAdapter.Dispose()
cn.Close()
End Sub

Formulario 8

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click


If (RadioButton1.Checked Or RadioButton2.Checked) Then
If RadioButton1.Checked Then
MsgBox("Respuesta correcta")
c=c+1
End If
If RadioButton2.Checked Then
MsgBox("Respuesta incorrecta")
End If
End If
Form9.Show()
Me.Hide()
End Sub

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


MyBase.Load
cn.Open()
Dim ConsultarDatos As String = "Select * From Preguntas "
Dim dataAdapter As New OleDb.OleDbDataAdapter(ConsultarDatos, cn)
dataAdapter.Fill(dt)
fila = 6
Label1.Text = CStr(dt.Rows(fila)("Preguntas"))
RadioButton1.Text = CStr(dt.Rows(fila)("Respuesta1"))
RadioButton2.Text = CStr(dt.Rows(fila)("Respuesta2"))
dataAdapter.Dispose()
cn.Close()
End Sub

Formulario 9

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click


If (RadioButton1.Checked Or RadioButton2.Checked) Then
If RadioButton2.Checked Then
MsgBox("Respuesta correcta")
c=c+1
End If
If RadioButton1.Checked Then
MsgBox("Respuesta incorrecta")
End If
End If
Form10.Show()
Me.Hide()
End Sub

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


MyBase.Load
cn.Open()
Dim ConsultarDatos As String = "Select * From Preguntas "
Dim dataAdapter As New OleDb.OleDbDataAdapter(ConsultarDatos, cn)
dataAdapter.Fill(dt)
fila = 7
Label1.Text = CStr(dt.Rows(fila)("Preguntas"))
RadioButton1.Text = CStr(dt.Rows(fila)("Respuesta1"))
RadioButton2.Text = CStr(dt.Rows(fila)("Respuesta2"))
dataAdapter.Dispose()
cn.Close()

Formulario 10

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click


If (RadioButton1.Checked Or RadioButton2.Checked) Then
If RadioButton1.Checked Then
MsgBox("Respuesta correcta")
c=c+1
End If
If RadioButton2.Checked Then
MsgBox("Respuesta incorrecta")
End If
End If
Form11.Show()
Me.Hide()
End Sub

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


MyBase.Load
cn.Open()
Dim ConsultarDatos As String = "Select * From Preguntas "
Dim dataAdapter As New OleDb.OleDbDataAdapter(ConsultarDatos, cn)
dataAdapter.Fill(dt)
fila = 8
Label1.Text = CStr(dt.Rows(fila)("Preguntas"))
RadioButton1.Text = CStr(dt.Rows(fila)("Respuesta1"))
RadioButton2.Text = CStr(dt.Rows(fila)("Respuesta2"))
dataAdapter.Dispose()
cn.Close()
End Sub

Formulario 11

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click


If (RadioButton1.Checked Or RadioButton2.Checked) Then
If RadioButton2.Checked Then
MsgBox("Respuesta correcta")
c=c+1
End If
If RadioButton1.Checked Then
MsgBox("Respuesta incorrecta")
End If
End If
Form12.Show()
Me.Hide()
End Sub

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


MyBase.Load
cn.Open()
Dim ConsultarDatos As String = "Select * From Preguntas "
Dim dataAdapter As New OleDb.OleDbDataAdapter(ConsultarDatos, cn)
dataAdapter.Fill(dt)
fila = 9
Label1.Text = CStr(dt.Rows(fila)("Preguntas"))
RadioButton1.Text = CStr(dt.Rows(fila)("Respuesta1"))
RadioButton2.Text = CStr(dt.Rows(fila)("Respuesta2"))
dataAdapter.Dispose()
cn.Close()
End Sub

Formulario 12

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click


If (RadioButton1.Checked Or RadioButton2.Checked) Then
If RadioButton1.Checked Then
MsgBox("Respuesta correcta")
c=c+1
End If
If RadioButton2.Checked Then
MsgBox("Respuesta incorrecta")
End If
End If
Form13.Show()
Me.Hide()
End Sub
Private Sub Form12_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
MyBase.Load
cn.Open()
Dim ConsultarDatos As String = "Select * From Preguntas "
Dim dataAdapter As New OleDb.OleDbDataAdapter(ConsultarDatos, cn)
dataAdapter.Fill(dt)
fila = 10
Label1.Text = CStr(dt.Rows(fila)("Preguntas"))
RadioButton1.Text = CStr(dt.Rows(fila)("Respuesta1"))
RadioButton2.Text = CStr(dt.Rows(fila)("Respuesta2"))
dataAdapter.Dispose()
cn.Close()

Formulario 13

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click


If (RadioButton1.Checked Or RadioButton2.Checked) Then
If RadioButton2.Checked Then
MsgBox("Respuesta correcta")
c=c+1
End If
If RadioButton1.Checked Then
MsgBox("Respuesta incorrecta")
End If
End If
Form14.Show()
Me.Hide()
End Sub

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


MyBase.Load
cn.Open()
Dim ConsultarDatos As String = "Select * From Preguntas "
Dim dataAdapter As New OleDb.OleDbDataAdapter(ConsultarDatos, cn)
dataAdapter.Fill(dt)
fila = 11
Label1.Text = CStr(dt.Rows(fila)("Preguntas"))
RadioButton1.Text = CStr(dt.Rows(fila)("Respuesta1"))
RadioButton2.Text = CStr(dt.Rows(fila)("Respuesta2"))
dataAdapter.Dispose()
cn.Close()
End Sub

Formulario 14

Private Sub Form14_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load


cn.Open()
Dim ConsultarDatos As String = "Select * From Preguntas "
Dim dataAdapter As New OleDb.OleDbDataAdapter(ConsultarDatos, cn)
dataAdapter.Fill(dt)
fila = 12
Label1.Text = CStr(dt.Rows(fila)("Preguntas"))
RadioButton1.Text = CStr(dt.Rows(fila)("Respuesta1"))
RadioButton2.Text = CStr(dt.Rows(fila)("Respuesta2"))
dataAdapter.Dispose()
cn.Close()

End Sub

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


Button2.Click
If (RadioButton1.Checked Or RadioButton2.Checked) Then
If RadioButton2.Checked Then
MsgBox("Respuesta correcta")
c=c+1
End If
If RadioButton1.Checked Then
MsgBox("Respuesta incorrecta")
End If
End If
Form15.Show()
Me.Hide()

Formulario 15

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click


If (RadioButton1.Checked Or RadioButton2.Checked) Then
If RadioButton2.Checked Then
MsgBox("Respuesta correcta")
c=c+1
End If
If RadioButton1.Checked Then
MsgBox("Respuesta incorrecta")
End If
End If
Form16.Show()
Me.Hide()
End Sub

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


MyBase.Load
cn.Open()
Dim ConsultarDatos As String = "Select * From Preguntas "
Dim dataAdapter As New OleDb.OleDbDataAdapter(ConsultarDatos, cn)
dataAdapter.Fill(dt)
fila = 13
Label1.Text = CStr(dt.Rows(fila)("Preguntas"))
RadioButton1.Text = CStr(dt.Rows(fila)("Respuesta1"))
RadioButton2.Text = CStr(dt.Rows(fila)("Respuesta2"))
dataAdapter.Dispose()
cn.Close()
End Sub

Formulario 16

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click


If (RadioButton1.Checked Or RadioButton2.Checked) Then
If RadioButton2.Checked Then
MsgBox("Respuesta correcta")
c=c+1
End If
If RadioButton1.Checked Then
MsgBox("Respuesta incorrecta")
End If
End If
Form17.Show()
Me.Hide()
End Sub

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


MyBase.Load
cn.Open()
Dim ConsultarDatos As String = "Select * From Preguntas "
Dim dataAdapter As New OleDb.OleDbDataAdapter(ConsultarDatos, cn)
dataAdapter.Fill(dt)
fila = 14
Label1.Text = CStr(dt.Rows(fila)("Preguntas"))
RadioButton1.Text = CStr(dt.Rows(fila)("Respuesta1"))
RadioButton2.Text = CStr(dt.Rows(fila)("Respuesta2"))
dataAdapter.Dispose()
cn.Close()
End Sub

Formulario 17

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click


If (RadioButton1.Checked Or RadioButton2.Checked) Then
If RadioButton1.Checked Then
MsgBox("Respuesta correcta")
c=c+1
End If
If RadioButton2.Checked Then
MsgBox("Respuesta incorrecta")
End If
End If
Form18.Show()
Me.Hide()
End Sub

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


MyBase.Load
cn.Open()
Dim ConsultarDatos As String = "Select * From Preguntas "
Dim dataAdapter As New OleDb.OleDbDataAdapter(ConsultarDatos, cn)
dataAdapter.Fill(dt)
fila = 15
Label1.Text = CStr(dt.Rows(fila)("Preguntas"))
RadioButton1.Text = CStr(dt.Rows(fila)("Respuesta1"))
RadioButton2.Text = CStr(dt.Rows(fila)("Respuesta2"))
dataAdapter.Dispose()
cn.Close()
End Sub
Formulario 18

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click


If (RadioButton1.Checked Or RadioButton2.Checked) Then
If RadioButton1.Checked Then
MsgBox("Respuesta correcta")
c=c+1
End If
If RadioButton2.Checked Then
MsgBox("Respuesta incorrecta")
End If
End If
Form19.Show()
Me.Hide()
End Sub

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


MyBase.Load
cn.Open()
Dim ConsultarDatos As String = "Select * From Preguntas "
Dim dataAdapter As New OleDb.OleDbDataAdapter(ConsultarDatos, cn)
dataAdapter.Fill(dt)
fila = 16
Label1.Text = CStr(dt.Rows(fila)("Preguntas"))
RadioButton1.Text = CStr(dt.Rows(fila)("Respuesta1"))
RadioButton2.Text = CStr(dt.Rows(fila)("Respuesta2"))
dataAdapter.Dispose()
cn.Close()
End Sub

Formulario 19

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click


If (RadioButton1.Checked Or RadioButton2.Checked) Then
If RadioButton1.Checked Then
MsgBox("Respuesta correcta")
c=c+1
End If
If RadioButton2.Checked Then
MsgBox("Respuesta incorrecta")
End If
End If
Form20.Show()
Me.Hide()
End Sub

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


MyBase.Load
cn.Open()
Dim ConsultarDatos As String = "Select * From Preguntas "
Dim dataAdapter As New OleDb.OleDbDataAdapter(ConsultarDatos, cn)
dataAdapter.Fill(dt)
fila = 17
Label1.Text = CStr(dt.Rows(fila)("Preguntas"))
RadioButton1.Text = CStr(dt.Rows(fila)("Respuesta1"))
RadioButton2.Text = CStr(dt.Rows(fila)("Respuesta2"))
dataAdapter.Dispose()
cn.Close()
End Sub

Formulario 20

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click


If (RadioButton1.Checked Or RadioButton2.Checked) Then
If RadioButton1.Checked Then
MsgBox("Respuesta correcta")
c=c+1
End If
If RadioButton2.Checked Then
MsgBox("Respuesta incorrecta")
End If
End If
Form21.Show()
Me.Hide()
End Sub

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


MyBase.Load
cn.Open()
Dim ConsultarDatos As String = "Select * From Preguntas "
Dim dataAdapter As New OleDb.OleDbDataAdapter(ConsultarDatos, cn)
dataAdapter.Fill(dt)
fila = 18
Label1.Text = CStr(dt.Rows(fila)("Preguntas"))
RadioButton1.Text = CStr(dt.Rows(fila)("Respuesta1"))
RadioButton2.Text = CStr(dt.Rows(fila)("Respuesta2"))
dataAdapter.Dispose()
cn.Close()

Formulario 21

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click


If (RadioButton1.Checked Or RadioButton2.Checked) Then
If RadioButton1.Checked Then
MsgBox("Respuesta correcta")
c=c+1
End If
If RadioButton2.Checked Then
MsgBox("Respuesta incorrecta")
End If
End If
Form22.Show()
Me.Hide()

End Sub

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


MyBase.Load
cn.Open()
Dim ConsultarDatos As String = "Select * From Preguntas "
Dim dataAdapter As New OleDb.OleDbDataAdapter(ConsultarDatos, cn)
dataAdapter.Fill(dt)
fila = 19
Label1.Text = CStr(dt.Rows(fila)("Preguntas"))
RadioButton1.Text = CStr(dt.Rows(fila)("Respuesta1"))
RadioButton2.Text = CStr(dt.Rows(fila)("Respuesta2"))
dataAdapter.Dispose()
cn.Close()
End Sub

Formulario 22

Private Sub Form22_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load


Label1.Text = c

End Sub

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


Button1.Click
cn.Open()
Dim GuardarDatos As String = " Insert into Alumnos(Matricula,Nombre,Calificacion) " & "Values ('" &
Form1.TextBox1.Text & "','" & Form1.TextBox2.Text & "','" & c & "')"
Dim dataAdapter As New OleDb.OleDbDataAdapter(GuardarDatos, cn)
dataAdapter.Fill(dt)
MsgBox("Se agregaron correctamente tus datos")
dataAdapter.Dispose()
cn.Close()
End Sub

You might also like