The OnClick event does indeed fire even when you navigate using keys. If you
want to carry out code specific to the mouse being clicked then there are at
least two things you can do:

1) set a flag on the key down event that you can check in the OnClick
event - ugly
2) just use the OnMouseDown event for processing mouse messages and use the
on-click for all other navigation code. Probably cleanest.

Cheers,
Phil.
----- Original Message ----- 
From: "Mark Howard" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, April 06, 2004 2:47 PM
Subject: [DUG] StringGrid problems


> Hi
>
> Still having problems with StringGrid events.
>
> I have some code that I want to run if a user clicks on a StringGrid.Row.
It's in the
> OnClick event.
>
> I have some other, purely grid-navigation, code that I want to run based
on the
> KeyDown event of the grid eg Home , End, Page Up/Down.
>
> It seems that whenever the cursor is moved within the grid (by the
navigation code),
> the OnClick event is triggered.
>
> Does this seem right or should I look elsewhere for something causing
this?
>
> If it is right, is there a way to prevent this auto-triggering of OnClick?
>
> Mark
>
> _______________________________________________
> Delphi mailing list
> [EMAIL PROTECTED]
> http://ns3.123.co.nz/mailman/listinfo/delphi
>

_______________________________________________
Delphi mailing list
[EMAIL PROTECTED]
http://ns3.123.co.nz/mailman/listinfo/delphi

Reply via email to