hi there. i really hate the tooltiptext header bug introduced in vfp9 sp2. i always wanted a fix or an easy workaround. i came with a simple solution that suits my needs, i hope it will work for someone else.

i really love the grid enhancements class of craig boyd and a lot of this class it's based in his code with a mix of cesar chalom's technic for tooltips in foxcharts.

in foxcharts, tooltips are simple vfp label objects.

one of the biggest requirements, was to be able to use the native tooltiptext property of the headers (to prevent additional coding in already implemented systems). i also added simple sorting options to the class. if you enable the lautosort property, when the users clicks the header the grid will be sorted by that column, and if the users clicks again the sort direction will be inverted. for sorting to work, the cursor should not be table buffered. this could be modified, but i just wanted a quick solution to suits my needs and for now, this does it.

to use it, simple drop an instance to a vfp form, and fill the property csourcegrid with the name of your grid like thisform.grdcategories, it has to be a name that can be evaluate it at runtime. the class will take the text stored in the tooltiptext property of the header object and display the tooltip when the mouse pointer moves to the header.

this class will respect the value of showtips form property.

sample form included. to run the sample, just extract the contents of the attached zip file, set the default location to this folder and run sample.scx

i hope you enjoy it.


Leave a Reply

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