Shock Level: VB Lord Registered: 30-03-2003 Posts: 150
Enter Character
I have this code setup to display every letter of an array (TEXT$ in this case) one by one, into a textbox, to give a "speaking effect".
my code:
Public Sub Dialogue_Handler()
GameScreen.Show
GameScreen.Refresh
GameScreen.MainText.Refresh
For lines = 1 To Textlen
For X = 1 To Len(Text(lines))
text_to_display$ = Mid(Text(lines), X, 1)
Select Case text_to_display$
Case "_": text_to_display$ = " "
Case ",": wait 300
Case " ": wait 170
Case ".": wait 400
Case Else: wait 90
End Select
GameScreen.SetFocus
GameScreen.MainText.Text = GameScreen.MainText.Text + text_to_display$
GameScreen.MainText.Refresh
Next X
wait 1000
endn2:
Next lines
End Sub
What im looking for is a way to skip lines other then using my _____ that will skip spaces, giving the effect of skipping a line.
in c++ theres a code for that, along the lines of /c of something like that. (i really have no idea).
could anyone do the least in telling me what character or command i could use to skip a line? thx.
ShocK
30-03-2003 at 06:50 PM
|
Shock Level: VB Lord Registered: 30-03-2003 Posts: 150
Re: Enter Character
ive tried using the CHR(13), but it just returns a | of greater thickness. could somebody please tell me how to return an enter key "character" ?
[Edited by Shock on 01-04-2003 at 12:56 AM GMT]
01-04-2003 at 12:56 AM
|
vbgen Level: Moderator Registered: 10-10-2002 Posts: 876
Re: Enter Character
...just lookin around...
if you want to skip to a new line... this might work..
'say you have a textbox Text1...
'and you want multiple lines...
text1.text = "Hi!" & vbcrlf & "this is a new line!" & vbcrlf & "And so is this! =]"
... that's all i have to say about that....
____________________________
Been busy trying to take a second degree <--it's not working out...
01-04-2003 at 01:06 AM
|
win_dir Level: VB Guru Registered: 04-08-2002 Posts: 390
Re: Enter Character
if you would like something easier to remember then try using "VbNewLine" instead of "VbCrLf" as vbgen suggested below. Both give exactly the same output but this way is the easiest. And like vbgen said, DON'T FORGET to set your text box to MultipleLines otherwise you will end up with something like "||" instead of a newline.
Comment on my test site to give me suggestions for improvements etc. it is at http://test.isgeeky.com. It is a site offering custom activex controls from £10 (approx $16)
Shock Level: VB Lord Registered: 30-03-2003 Posts: 150
Re: Enter Character
hey thank you both for your help. yea i set the textbox on multiple lines, something i learnt to do long ago before any coding. anyway it works perfectly in the equation Text$ = Text$ + "VbNewLine".
thank you again.
PS: many other sites didnt even bother to answer my question :/
01-04-2003 at 07:23 PM
|
win_dir Level: VB Guru Registered: 04-08-2002 Posts: 390
Re: Enter Character
AndreaVB.com is also the best, most responsive forum i have had the pleasure to be a member of. I think the Admin has been very successful with this website.
vbgen Level: Moderator Registered: 10-10-2002 Posts: 876
Re: Enter Character
i agree... for a forum with not such a big size(member-wise )... it's quite a good place to start, really.
although there still are other posts that aren't answered...
it's most probably because no one present has an answer...
which is human, i would say...
and it's starting to grow that people do say if they can't answer... just so that the one who posted knows that his or her post has been viewed with careful thought.
____________________________
Been busy trying to take a second degree <--it's not working out...