Tuesday, June 9, 2009
How to Get DBGrid Cell Coordinates on StatusBar
Do you like this story?
Source code from delphi.about.com for get DBGrid Cell Coordinate on statusbar was modified by newbiedelphiphp, look below source.
The code to show over what cell in a DBGrid the cursor is, and how to change the cursor on status bar:
procedure Tfrandom.DBGrid1MouseMove(Sender: TObject; Shift: TShiftState; X,Y: Integer);var pt: TGridcoord;beginpt:= DBGrid1.MouseCoord( x, y ) ;//change the cursor whe over titleif pt.y=0 thenDBGrid1.Cursor:=crHandPointelseDBGrid1.Cursor:=crDefault;If pt.X > 0 ThenbeginCaption := Format( 'Kolom: %d, Baris: %d, title: %s',[pt.x, pt.y, DBGrid1.columns[pt.x-1].title.caption] );statusbar.Panels[1].Text:=Caption;endElseCaption := Format( 'Kolom: %d, Baris: %d',[pt.x, pt.y] ) ;end;
I was used Borland Delphi 7, if you use delphi 6 i think it’s no different.
Enjoy it!!!

This post was written by: Franklin Manuel
Franklin Manuel is a professional blogger, web designer and front end web developer. Follow him on Twitter
Subscribe to:
Post Comments (Atom)

0 Responses to “How to Get DBGrid Cell Coordinates on StatusBar”
Post a Comment