Hi Francois,

What might work is using the inherited method inside something called
TMyButton = class(Tbutton). 

What I did for one application where a field was derived from TCustomEdit
was to overide the onclick handler.

 procedure Click; override;

Next inside the method I wrote the code that I wanted to run when the method
fired.  In this case I show.modal a large ASCII keyboard onto the touch
screen.  My user can touch the keys on the screen and enter data from there.
Once they hit enter I transfer the input data into the text field and then
call

inherited click;

The trick is to do your own code first.  Your code can decide what to do
with the keystroke and either pass it on or do a number of things.

John Dammeyer

Wireless CAN with the CANRF module now available.
http://www.autoartisans.com/products
Automation Artisans Inc.
Ph. 1 250 544 4950


> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Francois Piette
> Sent: Wednesday, October 19, 2005 1:55 AM
> To: [email protected]
> Subject: TStringGrid and Keyboard
> 
> 
> The situation:
>    I have a TFrame with a TStringGrid and a TBitBtn.
>    TBitBtn has an accelerator key (Let's say it is 'A').
>    TStringGrid has those options: goFixedVertLine, 
>    goFixedHorzLine, goVertLine,  goHorzLine, 
>    goColSizing, goColMoving and goRowSelect.
>    Note that goEditing is not in the options.
> 
> What happend:
>    When TStringGrid has focus, if the user hit the 'A' key 
>    (corresponding to TBitBtn accelerator), TBitBtn has his
>    OnClick triggered. TStringGrid doesn't see the 
>    key (OnKeyPress not triggered).
> 
>    Now if the user hit 'B' instead of 'A', as there is no 
>    accelerator key for 'B', TStringGrid has his 
>    OnKeyPress triggered.
> 
> What I need:
>     I need to have TStringGrid.OnKeyPress triggered for 
>     each laphanumeric key pressed by the user and have 
>     accelerator key working only when the user use the 
>     ALT key with the alphanumeric key.
> 
> Actually, I want to derive my own component from 
> TStringGrid to implement this behaviour.
> 
> Any help appreciated.
> 
> --
> [EMAIL PROTECTED]
> Author of ICS (Internet Component Suite, freeware)
> Author of MidWare (Multi-tier framework, freeware)
> http://www.overbyte.be
> 
> _______________________________________________
> Delphi mailing list -> [email protected]
> http://www.elists.org/mailman/listinfo/delphi
> 
> 

_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to