there have been a number of requests for  a tutorial on how to use the gdi+x classes and the shiny glass buttons. i am used to using these classes, so wrongly assumed that all users were up to speed. so i decided to fix that and post a tutorial about how to install and use gdi+x and the button class.

also i have made some updates to the class. it now respects the enabled property. also updated is the builder. tooltips, colours & fonts remembered, and a live form preview, courtesy of paco. download below.

lets go...

step 1 - download and install the gdi+x classes

the classes can be downloaded from the vfpx site from this page:

http://www.codeplex.com/wiki/view.aspx?projectname=vfpx&title=gdiplusx

click on the link on this page that says latest release of gdiplusx and download the latest stable release. do not download the beta as that is not complete and may not work properly

after downloading, extract the files to a directory.

2. download the new improved shiny glass buttons class from the attachment below. extract that to another folder. open the class in vfp and if it asks you where to find the gdiplus.vcx, navigate to the \source directory where you extracted the gdi+x classes and you will find gdiplus.vcx there. now close and save the class to resolve the links. this is because i do not supply the gdi+x classses and i do not know where you could have extracted them.

3. drop a button instance on a form. in vfp, from the menu tools open the class browser. then open the bbglassbuttonsx.vcx in the class browser. highlight the "glassbutton" item and drag and drop it on the form using the icon at the top left as shown.

4. right click on the button and select "properties' from the popup.

5. in the properties window, select the "favourites" tab, highlight the property "aaglassbtnbuilder" and click on the small button that appears.

6. the builder will now appear with the default settings. you can now change the colours as shown by the arrows.

the image below shows where each colour and font setting goes.

7. set your font properties

8. click "apply" to updte the preview. new. the button on your form will also update with an image of what your button looks like. 

9. click exit to close the builder. your properties will have been set to what you want and the form will show the button.

10. you are all set. run the form and see that you now have a shiny glass button that is responsive to your mouse movements. you can add code to the click event of the button as normal.

as mentioned i have made improvements to the builder:

tooltips, colour and font selection remembers original set colours and font attributes. a bitmap is generated when you click apply so you can now see what the button will look like on your form.(thanks to paco)

the class has also been updated. it now respects the enabled property so that you can now set the enabled property for the button as shown below.

i hope this tutorial shows you how to use these buttons. enjoy and get a pair of sun glasses if the glare off the shiny buttons gets too much. 🙂

unfortunately because of the amount of junk mail being generated from the weblog i have switched off comments. please post your comments, if any, at www.foxite.com

One Response to Shiny Glass Buttons updated and a tutorial

  • . says:

    Do they now work if you have an imnage in your picture property? I seem to recall they were opaque last time I tried to use them on such a form..?

    Have you actually tried this class? The Updated version does have a Picture Property so that you can see what the button looks like on a form. And the buttons have always been opaque. I never stated that they erer not opaque.

Leave a Reply

Your email address will not be published. Required fields are marked *