Board index » delphi » DBGrid possible with OnClick event?

DBGrid possible with OnClick event?

Hello,

How can i attach an Onclick event to a TDBgrid?
It only supports doubleclick.

 Bye        

-------------------------------------------------------------------------------
 Dirk Kissing [Almelo, The Netherlands]                  http://www.pi.net/~dk
-------------------------------------------------------------------------------

 

Re:DBGrid possible with OnClick event?


Quote
Dirk Kissing wrote:
> How can i attach an Onclick event to a TDBgrid?
> It only supports doubleclick.

You could try creating your own component, derived from TDBGrid, and
trap the WM_LBUTTONUP message.

--
Mark.

Re:DBGrid possible with OnClick event?


Quote
Mark Pritchard (pritc...@ozemail.com.au) wrote:
: Dirk Kissing wrote:

: > How can i attach an Onclick event to a TDBgrid?
: > It only supports doubleclick.
:
: You could try creating your own component, derived from TDBGrid, and
: trap the WM_LBUTTONUP message.

All components have an OnClick event -- you merely need to expose it
sometimes.  So, you just publish the OnClick event in your component:

TDBGridWithClick = class( TDBGrid )
published
   property OnClick;
end;

/Aaron Wieland

Other Threads