I have a DBGrid in which the first two columns are set so that if the user clicks on their title areas it will alter the indexname and range of the table the Grid is connected to. This is pretty standard stuff, but I wanted to add a feature whereby the cursor would change to a handpoint cursor over these two column's title areas when the mouse cursor was over them as an indicator that these columns can indeed be clicked to change the index. I looked around the net for different code examples, and came up with this, which is a variation of my own:
procedure TCalendarF10.CalendarGridMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); var pt: TGridcoord; begin pt:= CalendarGrid.MouseCoord(x, y); if (pt.x = 1) or (pt.x = 2) and (pt.y = 0) then CalendarGrid.Cursor:=crHandPoint else CalendarGrid.Cursor:=crDefault; end; Now although this does indeed change the cursor as wanted when over the title areas of the first two columns, which are the ones I have set to change the index being used, the entire column 1 shows the cursor change instead of just the title area! I can go all the way down a hundred rows and all of them will show the cursor change, yet for column 2 only the title area displays the cursor change as it should, and column 3 is not affected in any way...again, just as it should not! If I do not designate any Row pt at all, ( take pt.y = 0 out of the procedure ), then the entire columns 1 and 2 exhibit the cursor change including every row available. What is causing all the rows in column 1 to display the handpoint cursor while only the title area of column 2 displays it when using the code as shown above? And how, if at all possible, can I get just the title areas of columns 1 and 2 to exhibit the cursor change as wanted? Thanx in advance for your help! from Robert Meek dba Tangentals Design CCopyright 2006 Proud to be a moderator of "The Delphi Lists" at elists.org "When I examine myself and my methods of thought, I come to the conclusion that the gift of Fantasy has meant more to me then my talent for absorbing positive knowledge!" Albert Einstein _______________________________________________ Delphi-DB mailing list Delphi-DB@elists.org http://www.elists.org/mailman/listinfo/delphi-db