Saving contents of a Richtext box to a database

  • Thread starter Thread starter Mike Stephens
  • Start date Start date
M

Mike Stephens

I am having problems putting the RTF into a variable. Eg..

strText &= "FIRST TEXT"
strText &= RichTextbox1.RTF
strText &= "MORE TEXT HERE"

The problem is anything after the RTF is dropped off. If I look at the
strText it will have the "FIRST TEXT" and the content of the RTF file, but
not the "more text here"

Is this a bug or am I doing something so obvious that I can see it?

Regards,
Mike
 
Hello,

Mike Stephens said:
I am having problems putting the RTF into a variable. Eg..

strText &= "FIRST TEXT"
strText &= RichTextbox1.RTF
strText &= "MORE TEXT HERE"

The problem is anything after the RTF is dropped off. If I
look at the strText it will have the "FIRST TEXT" and the
content of the RTF file, but not the "more text here"

Maybe the text of the RichTextBox is terminated by a nullchar
('ControlChars.NullChar'). The messagebox and the IDE show only the
part of the text up to the first nullchar in the text, nevertheless, the
data is stored in the string.
 
I've tried all sorts, and so far nothing has worked. No matter what I do
the string is terminated.
 
Hello,

Mike Stephens said:
I've tried all sorts, and so far nothing has worked. No matter what
I do the string is terminated.

Try this:

\\\
Me.TextBox1.Text = Replace(s, ControlChars.NewLine, "")
///
 
Back
Top