ahorcado en visual basic
TRANSCRIPT
Es muy fácil, utilizaremos las siguientes herramientas:
TextBox : Estos son cuadros blancos rectangulares
Label: estos son cuadros similares a los TextBox
Line: son líneas rectas
Shape: son líneas rectangulares o ovaladas
Command: es una herramienta en visual que es cuadra o rectangular
Los TextBox los utilizamos para las respuestas del ahorcado, para responder y el numero de preguntas
Los Label es para el contexto de las preguntas
Las Line para formar el muñeco del ahorcado
Los Shape lo utilizamos para hacer el tallo que sostiene al ahorcado y también para hacer su cabeza
En cada TextBox les ponemos un nombre ej: Text1 esto son para las respuestas, Rta para responder , clave1 para la clave, No para el numero de preguntas
En los Label Label1 para las preguntas
En cada línea formando el muñeco ahorcado con sus mano, brazos etc, le ponemos un nombre ej: L1
Los Shape, para la cabeza L5, para el tallo L2
• Este es para devolver la pregunta
Private Sub Command5_Click()• If Adodc1.Recordset.EOF And Adodc1.Recordset.BOF Then• MsgBox "No hay registros en la base de datos",
vbExclamation, "Base de datos vacía"• Else• Adodc1.Recordset.MovePrevious• If Adodc1.Recordset.BOF Then Adodc1.Recordset.MoveFirst• End If• End Sub
• ESTE CODIGO ES PARA CONTINUAR LA PREGUNTAS
• Private Sub Command3_Click()
• • Select Case No.Text• Case 1• If Rta.Text = clave1.Text Then• Adodc1.Recordset.MoveNext• If Adodc1.Recordset.EOF Then• Adodc1.Recordset.MoveLast• End If• • Else• L1.Visible = True• • Adodc1.Recordset.MoveNext• If Adodc1.Recordset.EOF Then• Adodc1.Recordset.MoveLast• End If
• End If• • Case 2• If Rta.Text = clave1.Text Then• Adodc1.Recordset.MoveNext• If Adodc1.Recordset.EOF Then• Adodc1.Recordset.MoveLast• End If• • Else• L2.Visible = True• Adodc1.Recordset.MoveNext• If Adodc1.Recordset.EOF Then• Adodc1.Recordset.MoveLast• End If
• End If
• Case 3
• If Rta.Text = clave1.Text Then• Adodc1.Recordset.MoveNext• If Adodc1.Recordset.EOF Then• Adodc1.Recordset.MoveLast• End If• • Else• L3.Visible = True• Adodc1.Recordset.MoveNext• If Adodc1.Recordset.EOF Then• Adodc1.Recordset.MoveLast• End If• • End If
• Case 4
• If Rta.Text = clave1.Text Then• Adodc1.Recordset.MoveNext• If Adodc1.Recordset.EOF Then• Adodc1.Recordset.MoveLast• End If• • Else• L4.Visible = True• Adodc1.Recordset.MoveNext• If Adodc1.Recordset.EOF Then• Adodc1.Recordset.MoveLast• End If
• End If• • Case 5
• If Rta.Text = clave1.Text Then• Adodc1.Recordset.MoveNext• If Adodc1.Recordset.EOF Then• Adodc1.Recordset.MoveLast• End If• • Else• L5.Visible = True• Adodc1.Recordset.MoveNext• If Adodc1.Recordset.EOF Then• Adodc1.Recordset.MoveLast• End If
• End If• • Case 6
• If Rta.Text = clave1.Text Then• Adodc1.Recordset.MoveNext• If Adodc1.Recordset.EOF Then• Adodc1.Recordset.MoveLast• End If• • Else• L6.Visible = True• Adodc1.Recordset.MoveNext• If Adodc1.Recordset.EOF Then• Adodc1.Recordset.MoveLast• End If
• End If•
• Case 7
• If Rta.Text = clave1.Text Then• Adodc1.Recordset.MoveNext• If Adodc1.Recordset.EOF Then• Adodc1.Recordset.MoveLast• End If• • Else• L7.Visible = True• Adodc1.Recordset.MoveNext• If Adodc1.Recordset.EOF Then• Adodc1.Recordset.MoveLast• End If
• End If• • Case 8
• If Rta.Text = clave1.Text Then• Adodc1.Recordset.MoveNext• If Adodc1.Recordset.EOF Then• Adodc1.Recordset.MoveLast• End If• • Else• L8.Visible = True• Adodc1.Recordset.MoveNext• If Adodc1.Recordset.EOF Then• Adodc1.Recordset.MoveLast• End If
• End If• • Case 9
• If Rta.Text = clave1.Text Then• Adodc1.Recordset.MoveNext• If Adodc1.Recordset.EOF Then• Adodc1.Recordset.MoveLast• End If• • Else• L9.Visible = True• Adodc1.Recordset.MoveNext• If Adodc1.Recordset.EOF Then• Adodc1.Recordset.MoveLast• End If
• End If
• Case 10
• If Rta.Text = clave1.Text Then• Adodc1.Recordset.MoveNext• If Adodc1.Recordset.EOF Then• Adodc1.Recordset.MoveLast• End If• • Else• L10.Visible = True• Adodc1.Recordset.MoveNext• If Adodc1.Recordset.EOF Then• Adodc1.Recordset.MoveLast• End If
• End If• • Case 11
• If Rta.Text = clave1.Text Then• Adodc1.Recordset.MoveNext• If Adodc1.Recordset.EOF Then• Adodc1.Recordset.MoveLast• End If• • Else• Line11.Visible = True• Adodc1.Recordset.MoveNext• If Adodc1.Recordset.EOF Then• Adodc1.Recordset.MoveLast• End If
• End If• • Case 12
• If Rta.Text = clave1.Text Then• Adodc1.Recordset.MoveNext• If Adodc1.Recordset.EOF Then• Adodc1.Recordset.MoveLast• End If• • Else• Line12.Visible = True• Adodc1.Recordset.MoveNext• If Adodc1.Recordset.EOF Then• Adodc1.Recordset.MoveLast• End If
• End If•
• Case 13
• If Rta.Text = clave1.Text Then• Adodc1.Recordset.MoveNext• If Adodc1.Recordset.EOF Then• Adodc1.Recordset.MoveLast• End If• • Else• Line13.Visible = True• Adodc1.Recordset.MoveNext• If Adodc1.Recordset.EOF Then• Adodc1.Recordset.MoveLast• End If
• End If• • Case 14
• If Rta.Text = clave1.Text Then• Adodc1.Recordset.MoveNext• If Adodc1.Recordset.EOF Then• Adodc1.Recordset.MoveLast• MsgBox ("EL JUEGO HA TERMINADO")• End• End If• • Else• Line14.Visible = True• Adodc1.Recordset.MoveNext• If Adodc1.Recordset.EOF Then• Adodc1.Recordset.MoveLast• MsgBox ("EL JUEGO HA TERMINADO")• End• End If
• End If
• Case 15
• If Rta.Text = clave1.Text Then• Adodc1.Recordset.MoveNext• If Adodc1.Recordset.EOF Then• Adodc1.Recordset.MoveLast• End If• MsgBox ("EL JUEGO HA TERMINADO")• End
• Else• Line9.Visible = True• Adodc1.Recordset.MoveNext• If Adodc1.Recordset.EOF Then• Adodc1.Recordset.MoveLast• MsgBox ("EL JUEGO HA TERMINADO")• End• End If
• Case 16
• If Rta.Text = clave1.Text Then• Adodc1.Recordset.MoveNext• If Adodc1.Recordset.EOF Then• Adodc1.Recordset.MoveLast• End If• • Else• Line10.Visible = True• Adodc1.Recordset.MoveNext• If Adodc1.Recordset.EOF Then• Adodc1.Recordset.MoveLast• End If
• End If• • Case 17
• If Rta.Text = clave1.Text Then• Adodc1.Recordset.MoveNext• If Adodc1.Recordset.EOF Then• Adodc1.Recordset.MoveLast• End If• • Else• Line17.Visible = True• Adodc1.Recordset.MoveNext• If Adodc1.Recordset.EOF Then• Adodc1.Recordset.MoveLast• End If
• End If• • Case 18
• If Rta.Text = clave1.Text Then• Adodc1.Recordset.MoveNext• If Adodc1.Recordset.EOF Then• Adodc1.Recordset.MoveLast• End If• • Else• Line18.Visible = True• Adodc1.Recordset.MoveNext• If Adodc1.Recordset.EOF Then• Adodc1.Recordset.MoveLast• End If
• End If•
• Case 19
• If Rta.Text = clave1.Text Then• Adodc1.Recordset.MoveNext• If Adodc1.Recordset.EOF Then• Adodc1.Recordset.MoveLast• End If• • Else• Line19.Visible = True• Adodc1.Recordset.MoveNext• If Adodc1.Recordset.EOF Then• Adodc1.Recordset.MoveLast• End If
• End If• • Case 20
• If Rta.Text = clave1.Text Then• Adodc1.Recordset.MoveNext• If Adodc1.Recordset.EOF Then• Adodc1.Recordset.MoveLast• End If• • Else• Line20.Visible = True• Adodc1.Recordset.MoveNext• If Adodc1.Recordset.EOF Then• Adodc1.Recordset.MoveLast• End If
• End If
• End Select
• End Sub
• ESTE ES PARA FINALIZAR EL JUEGO
• Private Sub Command6_Click()• End
• End Sub