Results 1 to 2 of 2

Thread: Command Button Colour

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 1999
    Location
    London, England
    Posts
    213

    Post

    Quick question.

    Is it possible to change the colour of the Font on a command button. If so, how can I do it ?

  2. #2
    Guru Yonatan's Avatar
    Join Date
    Apr 1999
    Location
    Israel
    Posts
    892

    Post

    You can do this the easy way or the fun way!

    The easy way:
    Fake a CommandButton like this:
    1. Create a CheckBox.
    2. Set it's Style property to 1 (Graphical).
    3. Put this code in it:


    Private Sub Check1_Click()
    If Check1.Value = vbUnchecked Then Exit Sub
    If Check1.Value = vbChecked Then Check1.Value = vbUnchecked
    Call MsgBox("Put CommandButton code here...")

    End Sub


    The hard (fun) way to do this is to set the CommandButton's style to 1 (Graphical), subclass the form, catch WM_DRAWITEM messages and manually draw the button text. Tell me if you need an example...

    ------------------
    Yonatan
    Teenage Programmer
    E-Mail: [email protected]
    ICQ: 19552879
    AIM: RYoni69

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