Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: appending a multiline textbox in VB??  (Read 18604 times)

0 Members and 1 Guest are viewing this topic.

gamerx365

    Topic Starter


    Adviser
  • Radda Radda!
  • Thanked: 1
    • Yes
    • Yes
  • Experience: Experienced
  • OS: Windows 10
appending a multiline textbox in VB??
« on: September 18, 2008, 04:35:17 PM »
basically i need the code for this situation

i have something in line 1, 2, 3, and so on and i need to add something to the next line, whatever it might be. I've looked around and all I can find is skipping lines with the same command. What I want is with each new event I want it to input the event description into my text box.

gamerx365

    Topic Starter


    Adviser
  • Radda Radda!
  • Thanked: 1
    • Yes
    • Yes
  • Experience: Experienced
  • OS: Windows 10
Re: appending a multiline textbox in VB??
« Reply #1 on: September 18, 2008, 04:51:19 PM »
okay well never mind on the last part because i got it but now I need to have it scroll to the last line in the textbox when a line is added.

gamerx365

    Topic Starter


    Adviser
  • Radda Radda!
  • Thanked: 1
    • Yes
    • Yes
  • Experience: Experienced
  • OS: Windows 10
Re: appending a multiline textbox in VB??
« Reply #2 on: September 18, 2008, 05:33:19 PM »
okay well never mind on the last part because i got it but now I need to have it scroll to the last line in the textbox when a line is added.

now that i think about it I'll add details:

Using VB Express 2005

and my current code for adding text is:
Code: [Select]
advconsole.Text = advconsole.Text & vbCrLf & "Advanced console disabled"

lordvader781



    Intermediate
  • Thanked: 1
    • Certifications: List
    • Computer: Specs
    • Experience: Experienced
    • OS: Windows 7
    Re: appending a multiline textbox in VB??
    « Reply #3 on: September 19, 2008, 08:34:45 AM »
    This is with VB.NET in Visual Studio 2005

    Code: [Select]
    RichTextBox.AppendText(vbCrLf & "This is a test")
    RichTextBox.ScrollToCaret()

    If you use AppendText() you don't need to grab the current text in the box.  ScrollToCaret() moves to the current position of the caret which, immediately after appending text, is at the bottom.

    gamerx365

      Topic Starter


      Adviser
    • Radda Radda!
    • Thanked: 1
      • Yes
      • Yes
    • Experience: Experienced
    • OS: Windows 10
    Re: appending a multiline textbox in VB??
    « Reply #4 on: September 21, 2008, 05:20:07 PM »
    dude thank you. lolz. of course i had like 30 lines of code that I had to go back and edit but thank you lolz.