I can intercept the mouse messages and play with it.
This is from one of my projects. Try to modify according to your needs.
This is not a working code, just a hint to help you to start from somewhere.
--------------------------
TYPE
TMouseStringGrid = class(TStringGrid)
private
procedure WMHScroll(var Msg: TMessage); message WM_HSCROLL;
public
...
published
end;
procedure TMouseStringGrid.WMHScroll(var Msg: TMessage);
begin
Here you process the Msg parameter;
Then MoveCarretOneCell;
inherited;
end;
-----------------------------------------
Also see:
procedure TCustomGrid.ScrollDataInfo(DX, DY: Integer; var DrawInfo:
TGridDrawInfo)
And:
Selection { property Selection: TGridRect; Indicates the boundaries of the
current selection.}
GetSelection
FocusCell
OnMouseDow
---------------------------
--- Whitehat <[EMAIL PROTECTED]> wrote:
> I have a TStringGrid in an app and the selected cell
> changes with the arrow keys.
>
> A new mouse with horizontal and vertival wheels moves
> the scrollbars on the grid but the selected cell remains
> the same.
>
> I can't program the mouse wheels to mimic the arrow keys,
> and, if I could, it would mess up other applications.
>
> So how can I make the wheels work like arrow keys in my
> application?
> __________________________________________________
> Delphi-Talk mailing list -> [email protected]
> http://www.elists.org/mailman/listinfo/delphi-talk
>
...and the traveler died, stroked by the beauty of the landscape.
THE MORNING OF THE MAGICIANS
Louis Pawels & Jacques Bergier
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
__________________________________________________
Delphi-Talk mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi-talk