So i've decided to make a tutorial on a simple program that responds to your words(made completely by ME, but i was helped by a few tutorials). It will use a different color the express what it's saying when you say specific words/anything. You can check the code for the words lol.
Well here it goes:
First open up VB 6.0.
Then make a few command buttons depending on how many responses you want to have.
Put their names as cmd"Blah" ("Blah" means put it as whatever you want it to be eg. "cmdName" would be the button to click to enter your name.
Captions can be whatever you want.
----------------------------------------------------------------
Now, for the coding:
[quote]
Private Sub cmdName_Click()
Dim strName As String
strName = InputBox("Enter your name:", "Name")
Select Case strName
Case "Trevor"
frmTest.ForeColor = vbGreen
Print "Hello there, "; strName; "."
Print "How old are you?"
Case Else
frmTest.ForeColor = vbPink
Print "Hello there, "; strName; "."
Print "How old are you?"
End Select
End Sub [/quote]----------------------------------------------------------------
Code Explanation:
[quote]strName = InputBox("Enter your name:", "Name")[/quote]Makes the InputBox (Box that requires you to type a response in)
with the title "Name" and the message "Enter your name:"

----------------------------------------------------------------
[quote]Case "Trevor"
frmTest.ForeColor = vbGreen
Print "Hello there, "; strName; "."
Print "How old are you?"[/quote]Also the above code would cause the form to be printed with:
[quote]"Hello there, ";strName; "."
"How old are you?"[/quote]The ;strName; is the "String" or response of the person In this case it's:
Case "Trevor" (meaning if the person answered "Trevor" as their name, it would print "Hello there, Trevor" and "How old are you?" in green.)
----------------------------------------------------------------
[quote]Case Else
frmTest.ForeColor = vbRed
Print "Hello there, "; strName; "."
Print "How old are you?" [/quote]This code would print the text:
"Hello there,"; strName; "."
"How old are you?"
ONLY if the response of the person was something other then "Trevor".
P.S - You may have noticed that i put:
[quote]"Hello there,"; strName; "."
"How old are you?"[/quote]Twice in both of the "Case" codes, this is kind of like insurance so that it will actually print something rather then nothing. (I found that if i didn't add it twice, it would only print those lines if i answered "Trevor" as the response.
And as always before the "End Sub" function in the code, put a
"End Case" to end the "Case"
Please note that there will be an error if you don't add the
"End Case" function to the coding.
----------------------------------------------------------------
Ok now we're done with the code for your name.
You can use the same structure for every button.
eg. cmdAge (cmdAge is the name for the button and Age would be the caption) would be:
[quote]
Private Sub cmdAge_Click()
Dim strAge As String
strAge = InputBox("Enter your Age:", "Age")
Select Case strName
Case "14"
frmTest.ForeColor = vbWhite
Print "WoW! "; strAge; " Years young!"
Print "What country do you live in"; strName; "?"
Case Else
frmTest.ForeColor = vbBlack
Print "WoW! "; strAge; " Years young!"
Print "What country do you live in"; strName; "?"
End Select
End Sub [/quote]And so on....
----------------------------------------------------------------
Code Explanation:
[quote]strAge = InputBox("Enter your Age:", "Age")[/quote]Makes the InputBox (Box that requires you to type a response in)
with the title "Age" and the message "Enter your Age:"
----------------------------------------------------------------
[quote]Case "14"
frmTest.ForeColor = vbWhite
Print "WoW! "; strAge; " Years young!"
Print "What country do you live in"; strName; "?"[/quote]The above code would cause the form to be printed with:
[QUOTE"]"WoW! "; strAge; " Years young!"
"What country do you live in"; strName; "?"[/quote]
The ;strAge; is the "String" or response of the person In this case it's:
Case "14" (meaning if the person answered "14" as their age, it would print ""WoW! "; strAge; " Years young!" and "What country do you live in"; strName; "?" in White)
----------------------------------------------------------------
[quote]Case Else
frmTest.ForeColor = vbBlack
Print "WoW! "; strAge; " Years young!"
Print "What country do you live in"; strName; "?"[/quote]This code would print the text (In black as specified):
"WoW! "; strAge; " Years young!"
"What country do you live in"; strName; "?"
ONLY if the response of the person was something other then "14".
P.S - You may have noticed that i put:
[quote]"WoW! "; strAge; " Years young!"
"What country do you live in"; strName; "?"[/quote]Twice in both of the "Case" codes, this is kind of like insurance so that it will actually print something rather then nothing. (I found that if i didn't add it twice, it would only print those lines if i answered "14" as the response.
And as always before the "End Sub" function in the code, put a
"End Case" to end the "Case"
Please note that there will be an error if you don't add the
"End Case" function to the coding.
----------------------------------------------------------------
So basically just change the str"blah" ("blah" being what you're asking eg. Age, Name, location.) according to what you're asking for each of the command buttons.
eg. strName
strAge
strCountry
And so on..
Also if you wanted to clear the text from the form.... Make a new button with the name "cmdClear" and Caption "Clear text"
Then open up the code for it and use this code:
[quote]Private Sub cmdClear_Click()
Cls
End Sub[/quote]If you need any further assistance please pm me or feel free to ask on this thread.
I've enclosed a sample.
EDIT - I've also added my GUI (My layout of the SmarterChild copy)

EDIT - I've re-attached the samples.
Thanks for the feedback!
Once again this tutorial was made completely by me, Travy92 but i had some help from oOTheNerdOo (The "Select Case" part) and thanks to tcm9669 for the screenshot program!.