Button Color in Forms (1 Viewer)

Phredd

Registered User.
Local time
Tomorrow, 06:56
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
 

Mile-O

Back once again...
Local time
Today, 21:56
Joined
Dec 10, 2002
Messages
11,316
No, but you can create a label that does the same job and customise that.
 

Attachments

  • dbbutton.zip
    10.1 KB · Views: 193

IMO

Now Known as ___
Local time
Today, 21:56
Joined
Sep 11, 2002
Messages
723
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
 

Phredd

Registered User.
Local time
Tomorrow, 06:56
Joined
May 28, 2002
Messages
34
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.
 

Mile-O

Back once again...
Local time
Today, 21:56
Joined
Dec 10, 2002
Messages
11,316
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.
 

Phredd

Registered User.
Local time
Tomorrow, 06:56
Joined
May 28, 2002
Messages
34
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

Top Bottom