Results 1 to 12 of 12

Thread: Forecolor on a command button?

  1. #1

    Thread Starter
    PowerPoster BruceG's Avatar
    Join Date
    May 2000
    Location
    New Jersey (USA)
    Posts
    2,657
    Is there an API that can be used to set the forecolor (for the text) of a command button? A Forecolor property is conspicuously absent from the command button's property list. (You can change the backcolor when the Style is set to Graphical, but no forecolor!)
    "It's cold gin time again ..."

    Check out my website here.

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    save yourself an API call by using the command button under the "Forms 2.0 Library" component...
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  3. #3
    Guest
    Place a Checkbox on the form and set it's Style to 1-Graphical.

    And the results, you get a command button, where you can change the forecolor. Only thing is, the button stays clicked, but you can add this to it to unclick it.


    Code:
    Private Sub Check1_Click()
    
        If Check1.Value = vbChecked Then
            Check1.Value = vbUnchecked
        End If
        
    End Sub

  4. #4
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Matthew, wouldn't it be easier to use my method, you know...save yourself some code??
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  5. #5
    Guest
    It'd take up less space.
    Because he'd have to include the VB6 runtimes along with the Forms 2.0 Library component (whatever file that is).

    I don't find using a checkbox a lot of code, it's simple and all you have to include are the VB6 runtime library files.

  6. #6
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    sounds good...
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  7. #7
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217
    hey wouldnt't

    Private Sub Check1_Click()

    Check1.Value = vbUnchecked

    End Sub

    be easier than

    Private Sub Check1_Click()

    If Check1.Value = vbChecked Then
    Check1.Value = vbUnchecked
    End If

    End Sub

    ??????
    Remember, if someone's post was not helpful, you can always rate their post negatively .

  8. #8
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    'try this and see what happens
    Code:
    Private Sub Check1_Click()
        MsgBox "help"
        Check1.Value = vbUnchecked
    End Sub
    
    'or
    
    Private Sub Check1_Click()
        MsgBox "help"
        If Check1.Value = vbChecked Then
            Check1.Value = vbUnchecked
        End If
        
    End Sub
    'seems Form2.0 is a better answer
    Last edited by HeSaidJoe; Jan 29th, 2001 at 10:01 PM.
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  9. #9
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217
    they did the same thing .... they messaged box twice
    Remember, if someone's post was not helpful, you can always rate their post negatively .

  10. #10
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217
    this works

    If Check1.Value = vbChecked Then
    Check1.Value = vbUnchecked
    MsgBox "help"
    End If
    Remember, if someone's post was not helpful, you can always rate their post negatively .

  11. #11
    Guest
    Yup, BuggyProgrammer has the correct idea, I did the same exact thing for the Binary Encrypt/Decryptor I made a while ago.

  12. #12

    Thread Starter
    PowerPoster BruceG's Avatar
    Join Date
    May 2000
    Location
    New Jersey (USA)
    Posts
    2,657
    Thanks a lot for all of your responses, guys. The checkbox thing works fine. I appreciate it.
    "It's cold gin time again ..."

    Check out my website here.

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