Results 1 to 9 of 9

Thread: font colour

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Dec 2000
    Posts
    157
    does anyone know how i change the colour of a font in runtime,
    what i am trying to do is on a form for a customer to fill out, if the customer misses out a question or answers it incorrectly i want the label for that question to turn say red.
    i tried the help library
    and it says
    object.BackColor [= color]
    but i tried replacing color with red
    and even tried [=2550000] but i get an invalid property error what is wrong

  2. #2
    Guest
    Try:


    Code:
    object.BackColor = vbRed

  3. #3
    Fanatic Member
    Join Date
    Sep 1999
    Location
    Bethel, North Carolina, USA
    Posts
    987
    If you want to change the font color I believe you should the Forecolor property not the backcolor property.

    Code:
    object.ForeColor = RGB(255,0,0)
    {Insert random techno-babble here}

    {Insert quote from some long gone mofo here}

  4. #4
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628
    since vb colors are backwards, red would be &Hff, or 255, not 2550000 (which was also wrong, by the way)
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  5. #5
    Guest
    Red is RGB(255,0,0)

  6. #6
    Addicted Member
    Join Date
    Feb 2001
    Location
    Classified
    Posts
    234

    Blind

    mebe im just blind, but i see no command1.Forecolor
    :P


    and the backcolor dosent change the font color
    mebe you could bitblt it onto the control.. but that would just be lame, their must be some way to do this, ither thru the api or vb...
    My ICQ Status: (85634850)

    Seriously Sick Tshirts

  7. #7
    Fanatic Member
    Join Date
    Sep 1999
    Location
    Bethel, North Carolina, USA
    Posts
    987
    The forecolor of a command button is based on windows color settings.
    {Insert random techno-babble here}

    {Insert quote from some long gone mofo here}

  8. #8
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628
    yeah. I forgot. Sorry :[
    over the years, controls blur together in your mind...
    i tried the settextcolor api call, and it doesn't seem to work on command buttons. All i can suggest is: Make a small bitmap in "Paintbrush" and use it as the button picture. you can use the same pic for up and down. The bitmap will be of the command button text in the color of your choice. There are other benefits of this method as well.
    System font settings dont affect the button display, potentially making the button unreadable. Trust me, its real easy. A large point font will word-wrap to the next line, which isn't visible, etc. Trust me, it's not worth the headache of trying to resize the buttons.
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  9. #9
    Guest
    Use the CommandButton shipped with Sheridan 3D Controls. It's exactly the same as the standard button, expect it's a little more flexible (which includes changing the forecolor of the button).

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