-
October 16th, 2004, 10:58 PM
#1
*HELP* Beginner: Loops and textboxes
*HELP* Beginner! Simple VB6 questions that I can't solve!
--------------------------------------------------------------------------
Hey guys,
I've been working with VB for a while now but I can't get loops to work with textbox's; is this possible?
Here's my code that won't work:
Private Sub cmdStart_Click()
a = 5
y = " test"
Do Until a = 1
Text1.Text = a & y
Loop
End Sub
----------------------
I'm trying to make it so it will count down in the textbox but it's not working.
I can get it to work with the picture box but something else interfered with that aswell.
Another question is with the text-to-speech component, is it possible to get it to speak whatever is printed into the picture box?
I know it's possible to get the text-to-speech to read whats in the textbox but I can't get the loops to work in the text box!!!
To get the speech to work with a textbox I have to type in...
"spkSpeak.speak text1.text"
Please help! thanks.
-
October 17th, 2004, 01:59 AM
#2
Re: *HELP* Beginner! Simple VB6 questions that...
Hi.
Regarding your first question, try changing your code to this instead.
Code:
Private Sub cmdStart_Click()
a = 5
y = " test"
Do Until a = 1
Text1.Text = a & y
a = a - 1
Loop
End Sub
Regards,
Michael
-
October 17th, 2004, 02:27 AM
#3
Re: *HELP* Beginner! Simple VB6 questions that...
I agree, that should fix the problem.
Sorry if I am changing the topic but can you tell me more about the speak code, that could be very useful in my school project I am doing atm.
thx
-
October 17th, 2004, 08:54 AM
#4
Re: spkSpeak.speak text1.text
see if this can help you:
put
spkSpeak.speak text1.text
under change event of text box,
may be conditioned to get the enter key
or under the
Validate event of textbox
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
-
October 17th, 2004, 11:48 AM
#5
Re: *HELP* Beginner: Loops and textboxes
YIKES! that's what I forgot! haha ... i knew that *wink*
Thanks alot.
My objective is to get the text to speech read what's in the text or picture box.
While in the text box or picture, it's looping numbers while I concatinate lyrics next to the looping variable.
I'm going to make the program basically sing a long song that repeats itself but with changing variables.
Ex. "The song that never ends..."
"99 bottles of beer on the wall..."
Thanks guys...I'll try and finish this program today and get back you guys! should be fun.
-
October 17th, 2004, 12:40 PM
#6
Re: *HELP* Beginner: Loops and textboxes
Well, I got the loop to work...
Next challenge is the text...what I want to do is have like a sing along caption going with the voice.
I have accomplished this with the picture box but it's going to be challenging with the textbox.
There's 2 ways I have thought of...
1: Having the lyrics to stay and the numbers to change.
ex. 5 bottles of beer on the wall,
5 bottles of beer,
you take one down, pass it around,
4 bottles of beer on the wall...
*Thing is! I can't get it to print text line by line even setting the properties to multiline(true)
Here's the code i've tried for this:
Other parts of the code
Text1.Text = i & a
Text1.Text = i & b
Text1.Text = c
Text1.Text = i & a
Other parts of the code
2: Having the line change as the song processes...
Ex. 5 bottles of beer on the wall
(Then that line erases)
5 bottles of beer!...
(Erases and keeps looping down)
Note: must create some sort of delay...I've gotten a delay to work with the picturebox but it wont work with the textbox!
I've created a fake variable to stall time:
(This is what i've put when I tried to make this program with a picbox)
Do until x = 10000000
x=x+1
Loop
This enabled me to set the time for when the numbers changed for the first example...
----------------------------------
Can anyone help or have any ideas? Would REALLY appreciate it!
-
October 17th, 2004, 12:42 PM
#7
Re: spkSpeak.speak text1.text
Originally Posted by Cimperiali
see if this can help you:
put
spkSpeak.speak text1.text
under change event of text box,
may be conditioned to get the enter key
or under the
Validate event of textbox
I'm not sure what you mean...I got the speech to work to read whatevers in the text though..
I wonder if it's possible to read whatever occurs in the picture box *scratches head*
-
October 17th, 2004, 08:31 PM
#8
Re: *HELP* Beginner: Loops and textboxes
Do you know how to change the 'pitch' or whatever its called of the text-to-speech component? It seems robotic, I want it to be more humanly or natural.
-
October 17th, 2004, 08:58 PM
#9
Re: *HELP* Beginner: Loops and textboxes
Yes, click on the "mouth" then configure the pitch in its property...
-
October 17th, 2004, 09:03 PM
#10
Re: *HELP* Beginner: Loops and textboxes
Thanks vigger, I'll try that one.
-
October 18th, 2004, 01:34 AM
#11
Re: *HELP* Beginner: Loops and textboxes
can anyone helpppp me?....
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|