Dim Lai As Integer
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = "13" Then
Res "Hola"
End If
End Sub
Public Sub Res(mensaje As String)
Randomize
Lai = Rnd * 10
If mensaje = "Hola" Then
Select Case Lai
Case "1"
Text2.Text = Text2.Text & vbCrLf & "Hola que te cuentas?"
Case "2"
Text2.Text = Text2.Text & vbCrLf & "Hola"
Case "2"
Text2.Text = Text2.Text & vbCrLf & "Hola, hoy no tengo ganas de hablar"
Case "3"
Text2.Text = Text2.Text & vbCrLf & "Hola, uff que dia llevo"
Case "4"
Text2.Text = Text2.Text & vbCrLf & "Hola, como te va?"
Case "5"
Text2.Text = Text2.Text & vbCrLf & "Hola, que pasa!?"
Case "6"
Text2.Text = Text2.Text & vbCrLf & "Hola, toy ocupado luego hablamos"
Case "7"
Text2.Text = Text2.Text & vbCrLf & "Hola, que pasa neng!"
Case "8"
Text2.Text = Text2.Text & vbCrLf & "Adios"
Case "9"
Text2.Text = Text2.Text & vbCrLf & "Toy cansado me voy ya"
Case "10"
Text2.Text = Text2.Text & vbCrLf & "No quiero hablar con tigo"
End Select
End If
End Sub
Se necesitan dos text box, text1 es para escibir, con multiline a false, y text2 para ver las respuestas, multiline a true en este