Button Color in Forms

Phredd

Registered User.
Local time
Tomorrow, 08:54
Joined
May 28, 2002
Messages
34
Guys,

Is there any simple way to change the BACKGROUND color of a button in a form from the standard grey to anything else.

Thanks
 
No, but you can create a label that does the same job and customise that.
 

Attachments

Create an oblong the size of the button you'd like in something like Paint, colour it and save it as a .bmp. Insert it into your form, Insert >>> Picture. In the properties of the picture on the form, Change the Special Effect to raised. In the 'On Mouse Down' event type this code...
Code:
Private Sub YourImage_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)

Me.YourImage.SpecialEffect = 2

End Sub
YourImage being the name of the image. In the 'Mouse Up' event type...
Code:
Private Sub YourImage_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)

Me.YourImage.SpecialEffect = 1

End Sub

This will make any image look like a button.

Hope this helps

IMO
 
Thanks

Mile-O-Phiile....

What was the trick to get the button to "Become Active".

I drew the shape etc, and started playing with "ON" events, but my button still thinks its a label.

Thanks guys, I think once I get this bit going I should be right.
 
WHat do you mean become active?

I just used the MouseDown, MouseUp, and OnClick events.

If you are asking about the hand cursor appearing like a hyperlink, I put a space in the Hyperlink property.
 
Got it ...thanks

I have said it before.....

This is the best place anywhere for getting quick and accurate responses to question.

Well done guys, and thanks
 

Users who are viewing this thread

Back
Top Bottom