borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2009 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (How do you get form parent in a class module?)Next Topic (I Need faster pixel graphics) New Topic New Poll Post Reply
AndreaVB Forum : VB General : Enter Character
Poster Message
Shock
Level: VB Lord


Registered: 30-03-2003
Posts: 150

icon 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
View Profile Send Email to User Show All Posts | Quote Reply
Shock
Level: VB Lord


Registered: 30-03-2003
Posts: 150
icon 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
View Profile Send Email to User Show All Posts | Quote Reply
vbgen
Level: Moderator

Registered: 10-10-2002
Posts: 876
icon 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
View Profile Send Email to User Show All Posts | Quote Reply
win_dir
Level: VB Guru

Registered: 04-08-2002
Posts: 390
icon 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)

[Edited by win_dir on 01-04-2003 at 05:42 PM GMT]

____________________________
We have a Mustek 5 M/Pix GSm@rt USB Digital Camera
for just £74.03 , offer only on until 30th February!

<AllDuck.com>      

Enquiries/Sales: 0845 430 9862
Fax: 0870 950 4532

01-04-2003 at 05:40 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
Shock
Level: VB Lord


Registered: 30-03-2003
Posts: 150
icon 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
View Profile Send Email to User Show All Posts | Quote Reply
win_dir
Level: VB Guru

Registered: 04-08-2002
Posts: 390
icon 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.

____________________________
We have a Mustek 5 M/Pix GSm@rt USB Digital Camera
for just £74.03 , offer only on until 30th February!

<AllDuck.com>      

Enquiries/Sales: 0845 430 9862
Fax: 0870 950 4532

01-04-2003 at 09:23 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
vbgen
Level: Moderator

Registered: 10-10-2002
Posts: 876
icon 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...

03-04-2003 at 01:35 AM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : VB General : Enter Character
Previous Topic (How do you get form parent in a class module?)Next Topic (I Need faster pixel graphics) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2009 Andrea Tincaniborder