Im making a program and want to answer a question like old QBasic input. with Text. How do I do that with VB5?
Printable View
Im making a program and want to answer a question like old QBasic input. with Text. How do I do that with VB5?
Well I don't know if this is what you want but you
could put a text box on the Form and make it respond
to a KeyPress event.
For example: If the question is "How old are you?"
you put something like this, but first, add a module
and place the following line of code in it:
Public YourAge As Integer
Now add this to a TextBox's Keypress event.
What this does is when the enter key is pressed, theCode:Private Sub Text1_KeyPress(KeyAscii As Integer)
' If the enter key is pressed then...
If KeyAscii = 13 Then
'If the question in the label is How old are you...
If lblQuestion.Caption = "How old are you?" Then
YourAge = Text1.Text 'Save the variable
'Change lblQuestion to a new question
lblQuestion = "Your Phone Number?"
End If
End If
End Sub
program checks if the qustion is "How old are you" then if
it is, number in the textbox is stored into the variable YourAge.
Then the lblQuestion is set to a new Question!