How can I change color of Text on a Visual Basic command button

1940 pts.
Tags:
VB4
Visual Basic
Visual Basic 4
Windows XP
Hi everyone, I have an array of Command buttons using Visual Basic 4 and I would like to change the color of the text on the buttons as well as change the back ground color of these buttons, can someone assist me please? Thank you.



Software/Hardware used:
Windows XP

Answer Wiki

Thanks. We'll let you know when a new response is added.

I don’t know of a way to do that.

In VB 6 <b>a workaround </b>was to use a Check box instead of a button, changing its style to “1 – Graphical” (which makes it look like a button).

Then you needed something like this to manage clicks:

<pre>Private Sub Check1_Click()
If Check1.Value = vbChecked Then
MsgBox (“clicked”)
Check1.Value = vbUnchecked
End If
End Sub</pre>

Also, there might be other components you could add to your project to use them instead of the standard buttons.

Discuss This Question: 5  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TheFinder
    Can someone explain how to do this. 'Make a record structure for font types.
    1,940 pointsBadges:
    report
  • TheFinder
    I have this fntName As String fntSize As Integer fntBold As Integer fntItalic As Integer fntColor As Long as types.
    1,940 pointsBadges:
    report
  • carlosdl
    I assume this is related to the original question. Is that right ? Where did you get that code ? What are you trying to do ?
    69,065 pointsBadges:
    report
  • carlosdl
    Oh, I see: Visual Basic Button Control v1.1 Sample. As mentioned in the original site, it is just a sample, and it is "intentionally incomplete and won't run by itself" You will have to fully understand what that code is doing in order to be able to make the necessary modifications to make it work.
    69,065 pointsBadges:
    report
  • TheFinder
    Yes and No, I could not get that to work as they say it won’t work, so I was building my own, and now need to get the buttons to change colors as I earlier mentioned.
    1,940 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following