Results 1 to 7 of 7

Thread: How do u copy Colored text from one RTB to another? <Resolved>

  1. #1

    Thread Starter
    Frenzied Member longwolf's Avatar
    Join Date
    Oct 2002
    Posts
    1,343

    How do u copy Colored text from one RTB to another? <Resolved>

    How do u copy Colored text from one Richtextbox to another?

    It should be easy, but I haven't found the way to do it.
    Last edited by longwolf; Jul 8th, 2004 at 04:46 PM.

  2. #2
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246
    A couple of ways have worked with me:
    VB Code:
    1. RichTextBox1.TextRTF = RichTextBox2.TextRTF
    2.  
    3. RichTextBox1.SelText = RichTextBox2.TextRTF

    Phreak

    Visual Studio 6, Visual Studio.NET 2005, MASM

  3. #3

    Thread Starter
    Frenzied Member longwolf's Avatar
    Join Date
    Oct 2002
    Posts
    1,343
    Thx phReAk!
    Sounds like they should work.

    Unfortunately, the RTB's I'm using are in UserControls.
    When I tried adding the TextRTF properties to the UserControl, VB6 went BOOM!!! LOL

    I'll post a Resolved if I can get the TextRTF properties working so I can test these.

  4. #4

    Thread Starter
    Frenzied Member longwolf's Avatar
    Join Date
    Oct 2002
    Posts
    1,343
    Got it working.

    Thx again phReAk

  5. #5
    another question of the same topic...
    i want to do something like this:
    VB Code:
    1. Text2.Text = Text2.Text & Text1.Text
    but with a RTB...
    i tried:
    VB Code:
    1. Text2.TextRTF = Text2.TextRTF & Text1.TextRTF
    but it dont work...
    if someone has the answer, plz tell me...

  6. #6
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    VB Code:
    1. Text2.SelStart = 200000 'Just some high number to put it at the end
    2. Text2.SelRTF = Text1.TextRTF

    Try that.
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  7. #7
    it worked!...tnx...then another question...
    how can i do this:
    VB Code:
    1. dim dat as string
    2. dat = text1.textrtf
    3. winsock1.senddata dat
    and in another form (or another computer):
    VB Code:
    1. dim dat as string
    2. winsock2.getdata dat
    3. text2.SelStart = Len(text2)
    4. text2.SelRTF = dat
    will this work? or is there a problem converting the text1.textrtf to string...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width