Results 1 to 8 of 8

Thread: [RESOLVED] Changing text colour of specific lines in a Text Box

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2009
    Posts
    5

    Resolved [RESOLVED] Changing text colour of specific lines in a Text Box

    I'm trying to change the font/text colour of specific lines in a Text Box. If there's a way to do this in a Label, that will work too.

    Thanks for the help.

  2. #2

  3. #3

    Thread Starter
    New Member
    Join Date
    Sep 2009
    Posts
    5

    Re: Changing text colour of specific lines in a Text Box

    Yes, I noticed while searching everyone asking about RTBs, but I haven't touched VB much in more or less 4 years so I'm not sure if I even have that control. Where would be a good place to get it?

    And thanks for welcoming me =)

  4. #4
    Frenzied Member
    Join Date
    Mar 2009
    Posts
    1,182

    Re: Changing text colour of specific lines in a Text Box

    Right click on toolbox>components>select Microsoft Rich Textbox Control 6.0>OK



    Good Luck
    Option Explicit should not be an Option!

  5. #5
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,929

    Re: Changing text colour of specific lines in a Text Box

    For examples of how to use it, see the "Controls" section of our Classic VB FAQs (in the FAQ forum)

  6. #6

    Thread Starter
    New Member
    Join Date
    Sep 2009
    Posts
    5

    Re: Changing text colour of specific lines in a Text Box

    Thanks si, that was a big help. Thanks to all of you.

    A new question arises in light of the use of an RTB... how do you set the alignment to Centered?

  7. #7
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,427

    Re: Changing text colour of specific lines in a Text Box

    It's usually better to start a new thread but...

    RichTextBox1.SelAlignment = vbCenter

    Also if you look in the CodeBank you'll find a thread bu member Moeur that has a lot of excellent tips on using the RTB.

  8. #8

    Thread Starter
    New Member
    Join Date
    Sep 2009
    Posts
    5

    Re: Changing text colour of specific lines in a Text Box

    Thanks Martin, and I looked at the CodeBank when si linked to his thread. Sorry for not making a new thread, I figured a quick answer would be good but I totally understand why you would say so.

    Anyways, back to programming!

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