Results 1 to 10 of 10

Thread: Changing fontcolor on a commandbutton

  1. #1

    Thread Starter
    Addicted Member LAURENS's Avatar
    Join Date
    Jan 2000
    Location
    Utrecht, the Netherlands
    Posts
    138
    Does anyone know how I can change the fontcolor on a commandbutton ? I remember I had a piece of code for it but I seem to have lost that.
    Regards,
    Laurens

    Using VB5 Enterprise edition SP3
    VB6 Enterprise edition SP5

  2. #2
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    use a checkbox with style set to graphical and value = 0 in the click:


    Private Sub Check1_Click()
    Check1.Value = 0'uncheck it






    End Sub
    Mark
    -------------------

  3. #3

    Thread Starter
    Addicted Member LAURENS's Avatar
    Join Date
    Jan 2000
    Location
    Utrecht, the Netherlands
    Posts
    138
    Mark,

    are you sure your are replying to this question ?
    Regards,
    Laurens

    Using VB5 Enterprise edition SP3
    VB6 Enterprise edition SP5

  4. #4
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    YES!

    Try it!


    you can then set the font colour
    Mark
    -------------------

  5. #5

    Thread Starter
    Addicted Member LAURENS's Avatar
    Join Date
    Jan 2000
    Location
    Utrecht, the Netherlands
    Posts
    138
    Thanks Mark,

    I was a bit puzzled by the checkbox, but I tried it and it works.
    Regards,
    Laurens

    Using VB5 Enterprise edition SP3
    VB6 Enterprise edition SP5

  6. #6
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744
    Of course, you can do it with a regular button, but it requires subclassing. But there is a better solution you can use. If you add Microsoft Forms 2.0 OCX then you would have a button there which allows you to change the forecolor.

  7. #7
    old fart Frans C's Avatar
    Join Date
    Oct 1999
    Location
    the Netherlands
    Posts
    2,926
    Or you could create a graphic with the text you want, and set style to graphical and picture to this graphic.

  8. #8
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Nitro
    Posts
    633
    How did you ever find that out Mark?
    Chemically Formulated As:
    Dr. Nitro

  9. #9
    Guest
    Or you can use Sheridan Threedee controls.

    By the way. I also found out about the CheckBox thing before. I found that out when i was playing around with the properties of different controls.

  10. #10
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    Nitro

    I read it on a well known VB forum (this one!)

    I just tried searching for the original thread but I couldn't find it.

    Mark
    -------------------

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