Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 [VB 2005 Express]Multiple Lines on a RichTextBox?
Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Raku




PostPosted: Fri Sep 21, 2007 6:17 pm   Post subject: [VB 2005 Express]Multiple Lines on a RichTextBox?

Ok..So I used the tool box to create a RichTextBox, and I'm trying to make it so it will output multiple lines when I click the button I'm using. I want it to output something like:

Level: lvl(the variable)
Attack: atk
Defense: def
Stamina: stm

etc. in the RichTextBox..how can I do this? Or is there something else I need to use to output something like this?
Sponsor
Sponsor
Sponsor
sponsor
rdrake




PostPosted: Fri Sep 21, 2007 6:45 pm   Post subject: RE:[VB 2005 Express]Multiple Lines on a RichTextBox?

Make sure the MultiLine property is set to true. I believe you want to use the Append() method to add text to what's already there.
code:
rtb.MultiLine = true;
rtb.Append("Line 1\nLine 2");
Pretty much a guess as I'm too lazy to whip open Visual Studio, but that sounds about right.

EDIT: On second thought, it's probably more like this:

code:
rtb.MultiLine = true;
rtb.AppendText("Level:  " + lvl + "\nAttack:  " + atk + "\nDefense:  " + def + "\nStamina:  " + stm);
Display posts from previous:   
   Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: