Navigate to your events tab DBGrid
and double click on OnMouseMove
. Delphi will automatically create the event, you will check the coordinate X
which would be the horizontal so would be the column, so you should know which column would be the links of the emails, and if for example were the column 3
it would check if it was empty and serve Cursor, see how it would work:
You first have to declare a Type
to access private properties:
type
THackGrid = class(TCustomDBGrid); //criar uma nova classe pra acessar as propriedades privadas
And here the function of MouseMove
:
procedure TForm1.DBGrid1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
var
pt: TGridcoord;
MouseScrPt : TPoint;
OrigActiveRecord : integer;
begin
pt:= DBGrid1.MouseCoord(x, y);
if dgTitles in DBGrid1.Options then Dec(pt.y); //se o titulo é mostrado então ajusta a row index(-1) para nao dar erro de argument out of range
if dgIndicator in DBGrid1.Options then Dec(pt.x); //se o indicador é mostrado então ajusta a column index (-1) para nao dar erro de argument out of range
if THackGrid(DBGrid1).DataLink.Active and (pt.y>=0) and (pt.x>=3) then
begin
THackGrid(DBGrid1).DataLink.ActiveRecord:= pt.y;
if (DBGrid1.Columns[pt.x].Field.AsString <> '') and (pt.x=3) then
DBGrid1.Cursor:=crHandPoint
else
DBGrid1.Cursor:=crDefault;
end;
end;
Which version of Delphi are you using?
– Paulo Roberto Rosa
I’m using version XE4
– Edder
Right, and what is this "Table" component you’re using? Wouldn’t it be a grid?
– Paulo Roberto Rosa
I am using Dbgrid
– Edder