CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2001
    Location
    Naperville, IL
    Posts
    2

    Change the color of a button's text

    How do I change the color of the button's text. There is not foreground color to set. So I have tried to change the button's MaskColor property. Then I set the UseMaskColor property to true. And the color of the button's text still remains black. I need it to be white. There has to be a simple solution to this and I am just not seeing it. So if anyone could help me.


  2. #2
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: Change the color of a button's text

    Change Style to Graphical and then change the background color

    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

  3. #3
    Join Date
    Mar 2001
    Location
    Naperville, IL
    Posts
    2

    Re: Change the color of a button's text

    I forgot to mention that in my first post. I have the Style set to Graphical. This allowed me to change the background color of the button. But I still cannot change the color of the text on the button. Should changing the style to Graphical allow me to change the color of the text on the button. So far no matter what I have tried the text color is always black.


  4. #4
    Join Date
    Feb 2001
    Location
    PA
    Posts
    163

    Re: Change the color of a button's text

    Don't think that changing the caption forecolor is intrinsic to that command button. Try adding the the Sheridan 3D controls (threed32.ocx) to your project. You can change the forecolor of the Sheridan command button.


  5. #5
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: Change the color of a button's text

    Put textbox over command button caption. Set the backolor of the text box to the color of the command button, set borders to None. Change the ForeColor of the Text box.
    If you use this, don't forget to add
    Private Sub Text1_Click()
    Command1_Click
    End Sub

    It will fire click event of the Command1 button when you click on the text box

    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

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

Featured