The solution is to override CMDialogChar in the form. No need to change
anything at component level.
procedure CMDialogChar(var Message: TCMDialogChar);
message CM_DIALOGCHAR;
...
procedure TForm1.CMDialogChar(var Message: TCMDialogChar);
{ Ignore accelerators without an [ALT] key }
begin
if ((Message.KeyData and $20000000) = 0) then Message.Result := 1
else inherited;
end;
Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html
--
[EMAIL PROTECTED]
The author for the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
http://www.overbyte.be
----- Original Message -----
From: "John Dammeyer" <[EMAIL PROTECTED]>
To: "'Borland's Delphi Discussion List'" <[email protected]>
Sent: Thursday, October 20, 2005 10:47 AM
Subject: RE: TStringGrid and Keyboard
> 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
_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi