Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

button properties

Status
Not open for further replies.

ejhemler

Programmer
Aug 30, 2002
68
US
Is there a way to change the background color of a button so that it is the same color as the form? This way only the word that is on the button will appear. I'm trying to create clickable text. Is there an easier way? Thanks.

Erik
 
HI

1. In VFP8.. this can be set by choosing the background color property.

2, In VFP7.. instead of using command buttons..
Drop the OLE ActiveX control (just as you drop Command button)...
Choose the 'Microsoft Forms 2.0 CommandButton' control on to the form. Resize it to the command buttons size and set its properties and command codes as you would do for a command button.

Now the trick is... you cannot fill up the backcolor property since it is disabled. But instead.. put the code in the InitEvent of that control..
This.BackColor = RGB(255,128,128) .. for example.
Save and run. You are done :)

ramani :)
(Subramanian.G)
 
Ramani,
I forgot to say that I'm using VFP6. Would I still do the same as in 7?
 
HI
Try :).. I dont have it in my desktop right noe, but it should work. :)

In the Actiovex Controls InitEvent, you can oput

This.BackColor = ThisForm.BackColor

Another Idea is to have this button control as your class and have them in your forms from this class.. will be a good idea :)

ramani :)
(Subramanian.G)
 
Erik,

You say "I'm trying to create clickable text"

Label objects have Click methods and you can set the background to be transparent, why not use one of those?

Obviously you won't get the depressing action you get with a button.

Stewart
 
Never thought of that. Sometimes it's right in front of you. Thanks Stewart and Ramani.

Erik
 
ejhemler

Is there a way to change the background color of a button so that it is the same color as the form?

faq184-3534

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top