Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Coloured command buttons
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00091273
Message ID:
00091634
Views:
17
Thanks James,

Ignore my previous message. I read your fist message before this one.

Michel Creppy.

================= Your original message follows =====================

Michel:

I was going to send you may code this morning, but Cetin's code does the job nicely -- and is
cleaner than the stuff I wrote 2 years agon for VFP3.

I would add two properties to mybutton, .picture and .disabledpicture. mybutton.picture would
contain the name of the picture normally exposed on the button, i.e. "files.bmp" and
.disabledpicture would contain the name of the image exposed when the button is depressed or
disabled (.enabled = .F.) Using a second image gives you the ability to gray-out the image when
the user clicks mybutton, just like a real commandbutton. To keep tract of related files, I usually
stick an "x" of the disabled version of an images, such as "filesx.bmp" as the greyed-out
counterpart of "files.bmp".

Using these two images, you can grey out myButton when the user clicks it with the following code:

*-- myButton.MouseDown()

.specialeffect = 1 && Sunken
this.image1.picture = .disabledpicture && Grayed out picture
this.label1.enabled = .F. && Displays label caption as disabled

RETURN

and in MouseUp(), the following:

*-- myButton.MouseUP()

.specialeffect = 0 && raised
this.image1.picture = .picture && normal image
this.label1.enabled = .T. && normal caption display

RETURN

To the user, the button appears to recess and the image and caption gray out when the
mousebutton is press, and return to normal when the button is released. This emulates the
action/appearance of a command button.

Regards,

JME

jmEdgar
JurixDataCorporation
jurix@navix.net
Previous
Reply
Map
View

Click here to load this message in the networking platform