Hola.
A ver si así hace mas o menos lo que buscas...
Código Delphi
[-]
...
private
procedure MMouseEvent(var Msg: TMsg; var Handled: Boolean);
end;
...
implementation
procedure TForm1.FormCreate(Sender: TObject);
begin
Application.OnMessage := MMouseEvent;
end;
procedure TForm1.MMouseEvent(var Msg: TMsg; var Handled: Boolean);
var
P: TPoint;
begin
P:= ScreenToClient(Mouse.CursorPos);
if PtInRect(DBGrid1.BoundsRect,P) then
begin
if P.X = DBGrid1.Left + GetSystemMetrics(SM_CXVSCROLL) then
SendMessage(DBGrid1.Handle, WM_HSCROLL, SB_LINELEFT, 0);
if P.X = DBGrid1.Left+DBGrid1.Width - GetSystemMetrics(SM_CXVSCROLL) then
SendMessage(DBGrid1.Handle, WM_HSCROLL, SB_LINERIGHT, 0);
end;
end;
...
Saludos.