Results 1 to 5 of 5

Thread: Change the color of text in a textbox?

  1. #1

    Thread Starter
    New Member Martin's Avatar
    Join Date
    Apr 1999
    Location
    Alleroed, Denmark
    Posts
    10

    Question

    I once heard rumors that i could change colors of parts of the text in a textbox. Sort of like a html-editor with syntax highlighting or Word or whatever.

    Is it true, and if yes, how can it be done?


    I would greatly appreciate your help, so thanks in advance.
    Martin

  2. #2
    Guest
    You cannot do this in a regular Textbox. To change color, you have to use the RichTextBox Control. And it's .SelColor property.

  3. #3

    Thread Starter
    New Member Martin's Avatar
    Join Date
    Apr 1999
    Location
    Alleroed, Denmark
    Posts
    10

    Thumbs up Thanks

    You're da man!
    Martin

  4. #4
    Guest
    You can however change the whole textbox to a certian colour. This is done via the ForeColor property.

  5. #5
    Guest
    Keep in mind, Megatron, that a regular Textbox is not the perfect thing for an html-editor because the text can go beyond the limit of a textbox's maximum length.

    Also, a textbox cannot change certain word's colors. A regular textbox can have only 1 color which is the forecolor. A RichTextBox can have many colors using the .SelColor property.

    Even though you already know this, just letting you know that a regular textbox is not the best thing for this certain task .

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