Results 1 to 8 of 8

Thread: Color for single character on button

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2022
    Posts
    15

    Color for single character on button

    Hi everyone!

    Is there anyway to set a different color to one charater on a button?

    Example:

    A button with the text: "Start" where all the letters are white except for the letter "a" which is yellow or something.

    Thanks.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Color for single character on button

    No there isn't. You would have to draw the text yourself, calling DrawString multiple times with a different Pen each time.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2022
    Posts
    15

    Re: Color for single character on button

    Thank you for your reply

  4. #4
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,413

    Re: Color for single character on button

    Quote Originally Posted by Anderskd1 View Post
    Hi everyone!

    Is there anyway to set a different color to one charater on a button?

    Example:

    A button with the text: "Start" where all the letters are white except for the letter "a" which is yellow or something.

    Thanks.
    You could do that in WPF, but not so easily in winforms

  5. #5
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,102

    Re: Color for single character on button

    I would also caution you against doing that in any case. I can think of some reasons to do that which might seem appealing, but I had a boss who was red-green color blind and an employee who was totally color blind. Listening to them discuss a colorful interface I had created for an application was...enlightening.

    The bottom line is: Think twice before creating an interface that relies too much on color.
    My usual boring signature: Nothing

  6. #6

    Thread Starter
    New Member
    Join Date
    Jan 2022
    Posts
    15

    Re: Color for single character on button

    Quote Originally Posted by Shaggy Hiker View Post
    I would also caution you against doing that in any case. I can think of some reasons to do that which might seem appealing, but I had a boss who was red-green color blind and an employee who was totally color blind. Listening to them discuss a colorful interface I had created for an application was...enlightening.

    The bottom line is: Think twice before creating an interface that relies too much on color.
    That sounds... like something you would not want to be on the receiving end of

  7. #7
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,102

    Re: Color for single character on button

    It was actually quite amusing. They both saw the interface, they just saw it differently from each other or any other non-color blind people. I was using colors to group like functionality. They saw the groupings differently from what I had intended. It wasn't unusable, it just wasn't all that it could have been.
    My usual boring signature: Nothing

  8. #8

    Thread Starter
    New Member
    Join Date
    Jan 2022
    Posts
    15

    Re: Color for single character on button

    Quote Originally Posted by Shaggy Hiker View Post
    It was actually quite amusing. They both saw the interface, they just saw it differently from each other or any other non-color blind people. I was using colors to group like functionality. They saw the groupings differently from what I had intended. It wasn't unusable, it just wasn't all that it could have been.
    I could imagine it being amusing, as long as they did not get mad at you for it

Tags for this Thread

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