Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Coloured command buttons
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00091273
Message ID:
00091563
Vues:
24
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
Jim Edgar
Jurix Data Corporation
jmedgar@yahoo.com

No trees were destroyed in sending this message. However, a large number of electrons were diverted from their ordinary activities and terribly inconvenienced.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform