Hi Joel,
Thanks again for your class.
I use VFP9 SP1 and our menu is complicated, so I can not just change it. I added the class on the fly to the grid's column instead of using HeaderClass. Gotcha - for some reason Header1 didn't work, but Header2 worked.
Another little adjustment - in the Header.Click event I reset MousePointer to default (otherwise it stays hourglasses - seems to be strange VFP bug).
>>>Works perfectly with small problem.
>>>
Can't find Function GoRec>
>Oops! I didn't realize I used that function. I will fix it on my blog, but the function is below.
>
>>I tried to use HeaderClass for the column, but then I got an error when I tried to run the form.
>
>This VFP9 SP2 bug may apply to you: If you open this form from the menu, you have to use the menu “Procedure” to open the form instead of “Command”. Otherwise, VFP9 will crash when you open the form.
>
>
>* GOREC.prg
>* Restore record number
>* lcAlias is optional
>* lcFailCode is optional, indicates where to go (TOP,BOTTOM) if record number can't be restored)
>Lparameters lnRecNo, lcAlias, lcFailCode
>Local llEof
>
>If Empty(lcAlias)
> lcAlias = Alias()
>EndIf
>
>If lnRecNo>Reccount(lcAlias)
> llEof = .t.
>EndIf
>
>If lnRecNo<>0 and lnRecNo<=Reccount(lcAlias)
> Go lnRecNo in (lcAlias)
>Else
> DO case
> Case llEof
> Go Bottom in (lcAlias)
> If !Eof(lcAlias)
> Skip in (lcAlias)
> Endif
> Case Empty(lcFailCode)
> * Record pointer stays put
> Case Upper(lcFailCode) = "T"
> Go Top in (lcAlias)
> Case Upper(lcFailCode) = "B"
> Go Bottom in (lcAlias)
> Otherwise
> * Record pointer stays put
> EndCase
>EndIf
>
If it's not broken, fix it until it is.
My Blog