Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

RichTextbox.textRTF format problems

Posted on 2005-05-11
2
Medium Priority
?
449 Views
Last Modified: 2012-06-27
Hi,

If I want to move the contents of richtextbox1 into richtextbox2 and preserve the text and colour format, I can do the following..

EXAMPLE 1 - richtextbox2.TextRTF = RichTextBox1.TextRTF

However, if I do this, then the result is all 'garbage.'

EXAMPLE 2 - richtextbox2.TextRTF = now() & RichTextBox1.TextRTF

I'm working on a private message feature for a chat program for work. Everything is working except that the private message text is coming through in the same format as the second example. I need to prefix the sent message with *PRV* and the UserName name so that the client knows it is a private message....What I am doing is this...

WinPrivate.SendData "*PRV*" & ListOfUsers.List(userindex) & MsgWeAreSending.TextRTF

When the client recieves the private message, all the text has been stripped of it's formatting and the result is garbage. Any ideas what I am doing wrong!?? Thanks
0
Comment
Question by:wildarmsdave
2 Comments
 
LVL 96

Accepted Solution

by:
Bob Learned earned 200 total points
ID: 13986325
My suggestion would be to copy the RTF text, and then insert Now() into the second RichTextBox:

RichTextBox1.SelectionStart = 0
RichTextBox1.SelectedText = Now()

Bob
0
 

Author Comment

by:wildarmsdave
ID: 13991325
Hi Bob, I managed to sort this out myself using the same method that you suggested, although it baffled me for ages!! You can have the points. Thanks for taking the time to reply.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Having just graduated from college and entered the workforce, I don’t find myself always using the tools and programs I grew accustomed to over the past four years. However, there is one program I continually find myself reverting back to…R.   So …
The purpose of this article is to demonstrate how we can use conditional statements using Python.
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses
Course of the Month20 days, 15 hours left to enroll

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question