RichTextbox.textRTF format problems

Posted on 2005-05-11
Last Modified: 2012-06-27

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
Question by:wildarmsdave
    LVL 96

    Accepted Solution

    My suggestion would be to copy the RTF text, and then insert Now() into the second RichTextBox:

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


    Author Comment

    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.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Suggested Solutions

    Title # Comments Views Activity
    mirrorEnds challenge 6 65
    copyEvens challenge 6 46
    count7 challenge 12 52
    word0 challenge 4 37
    How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
    Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
    The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
    This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

    759 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

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now