Jump to content

RichTextBox HELP

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
4 replies to this topic

#1
WiiFan2012

WiiFan2012

    Newbie

  • Members
  • Pip
  • 5 posts
I'm writing a program that has two text boxes and a RichTextBox. The program will have users input data into multiple text boxes and when I press the "insert" button the text does get inserted into the RichTextBox, but when I click another insert button, the text from that textbox overwrites the RichTextBox's current text. How would I prevent this.

Thanks for your help.

#2
Blimp

Blimp

    Programmer

  • Members
  • PipPipPipPip
  • 154 posts
I need to assess the problem, are we trying to get text from both textbox1 and textbox2 into the richtextbox1?

#3
Deadlock

Deadlock

    Learning Programmer

  • Members
  • PipPipPip
  • 81 posts
What you need here is appending the text inside the 2 textboxes into the richtextbox each time the button is clicked. To append text use RTB.text &= "New text to append" OR RTB.AppendText("New text to append")

#4
WiiFan2012

WiiFan2012

    Newbie

  • Members
  • Pip
  • 5 posts
@Deadlock: Thats exactly what I needed, it works excellent!

One more thing, I would like the text to be inserted below the current entry. I suppose I can do that with vbNewLine?

Thanks for all your help!

#5
Deadlock

Deadlock

    Learning Programmer

  • Members
  • PipPipPip
  • 81 posts
yes Exactly, RTB.Text &= vbNewLine & "New TexT"