Results 1 to 5 of 5

Thread: Help with Rich text box

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2000
    Location
    USA
    Posts
    26

    Post

    I have searched and read previous posts regarding similar topics, but none seemed to help. What I want to do is have something sort of like how america online has their richtext box, where the names of the people typing are a certian color but the text they type is just black. What I have set up is a text box(txtEdit), and in the keydown event, i have it so when enter or chr(13) is detected, it sends text to the RTB. I want it to do someting like this:

    txtView.text = textView.text & (start of the color) UserName & ":" (end of color) & txtEdit.text

    (UserName is the persons handle, say "Mike". where txtEdit is the textbox they type into, and txtView is the RTB is shows up in)

    does anyone have any idea how I would do this? any help at all would be greatly appreciated.

  2. #2
    Hyperactive Member
    Join Date
    Aug 1999
    Location
    Glasgow,Scotland
    Posts
    281

    Post

    I don't know if this will be much use, but I saw an article on colour coding and such stuff at:
    http://www.vb-world.net/tips/tip148.html

    P.S: Does anyone know I can put a piece of text in a message on this board so it is a hyperlink (like the text above)?

  3. #3
    Hyperactive Member
    Join Date
    Aug 1999
    Location
    Glasgow,Scotland
    Posts
    281

    Post

    No need to tell me! I've just discovered it does it automatically.

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Jan 2000
    Location
    USA
    Posts
    26

    Post

    thanks, but the:

    previouscolor=rtfbox1.selcolor
    rtbox1.textrtf = left ( rtbox1.textrtf,len(rtbox1.textrtf)- len("MIKE"))
    rtbox1.selcolor = VBBlue
    rtbox1.textrtf = rtbox1.textrtf & "MIKE"
    rtbox1.selcolor= previouscolor


    that doesnt seem to work, isnt there a way to make html enabled with rtb? that would be alot easier

  5. #5
    Addicted Member
    Join Date
    Oct 1999
    Location
    Oporto, Portugal
    Posts
    134

    Post

    I believe you can put in the RTB_Change event code that checks if the user name was writen and change the color :

    RTBox1.SelColor = VBBlue

    How?

    By doing suposing the name is "MIKE" (4 char):

    previouscolor=rtfbox1.selcolor
    rtbox1.textrtf = left ( rtbox1.textrtf,len(rtbox1.textrtf)- len("MIKE"))
    rtbox1.selcolor = VBBlue
    rtbox1.textrtf = rtbox1.textrtf & "MIKE"
    rtbox1.selcolor= previouscolor

    I just wrote this piece so if it doesn't work stays the ideia.


    ------------------
    Jorge Ledo
    [email protected]
    Portugal

    [This message has been edited by JorgeLedo (edited 01-15-2000).]

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