Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 8 of 8 total
Thread keyboard shortcuts
Wed, Jul 4 2007 10:56 AMPermanent Link

Nathan
I have a project which connects with multiple tables in a database.  Currently I have a TButton which is used to enter 'edit' mode in the tables.  I was
wondering if it was possible to set a keyboard shortcut to do the same thing...ie. select a record and then press ctrl+e to edit the current record?

Thanks
Wed, Jul 4 2007 10:58 AMPermanent Link

Nathan
...oh, by the way, I'm using Delphi 5
Wed, Jul 4 2007 11:06 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Nathan <nathan@gmail.com> wrote:

...oh, by the way, I'm using Delphi 5


Dead easy - just set the form's KeyPreview to true, use the appropriate event (I'd suggest OnKeyPress) and issue the same table.edit as you do with the
button.
Wed, Jul 4 2007 10:34 PMPermanent Link

"Robert"

"Roy Lambert" <roy.lambert@skynet.co.uk> wrote in message
news:77401476-1E3B-400F-99E8-0E193E250E03@news.elevatesoft.com...
> Nathan <nathan@gmail.com> wrote:
>
> ..oh, by the way, I'm using Delphi 5
>
>
> Dead easy - just set the form's KeyPreview to true, use the appropriate
> event (I'd suggest OnKeyPress) and issue the same table.edit as you do
> with the
> button.
>

Or click the button, to avoid duplication of code.

Robert

Thu, Jul 5 2007 3:04 AMPermanent Link

Chris Erdal
Nathan <nathan@gmail.com> wrote in
news:3A19CDA9-AF4F-424A-8375-12F720F85A79@news.elevatesoft.com:

> I have a project which connects with multiple tables in a database.
> Currently I have a TButton which is used to enter 'edit' mode in the
> tables.  I was wondering if it was possible to set a keyboard shortcut
> to do the same thing...ie. select a record and then press ctrl+e to
> edit the current record?

You could transfer the code to an Action, and set the shortcut for the
action. Then you set the button to the action.

Oops - I'm not sure delphi 5 had actions...
--
Chris
(XP-Pro + Delphi 7 Architect + DBISAM 4.25 build 4 + EDB 1.04 build 3)

Thu, Jul 5 2007 10:53 AMPermanent Link

Nathan
Okay, I can get it to work for a single button press now, but how about if I wanted a multi-button command...eg. ctrl+e?


"Robert" <ngsemail2005withoutthis@yahoo.com.ar> wrote:


"Roy Lambert" <roy.lambert@skynet.co.uk> wrote in message
news:77401476-1E3B-400F-99E8-0E193E250E03@news.elevatesoft.com...
> Nathan <nathan@gmail.com> wrote:
>
> ..oh, by the way, I'm using Delphi 5
>
>
> Dead easy - just set the form's KeyPreview to true, use the appropriate
> event (I'd suggest OnKeyPress) and issue the same table.edit as you do
> with the
> button.
>

Or click the button, to avoid duplication of code.

Robert

Thu, Jul 5 2007 11:52 AMPermanent Link

"Larry Wadsworth"
> Okay, I can get it to work for a single button press now, but how about if
> I wanted a multi-button command...eg. ctrl+e?

You might try KeyDown event and use the code below

case Key of

   69:   begin

       if ssCtrl in Shift then

        Application.MessageBox ('Ctrl/E', '', MB_OK);

//       or whatever processing you want to do.

      end;

end;



Regards,

Larry Wadsworth

Thu, Jul 5 2007 2:02 PMPermanent Link

Nathan
Perfect, this is exactly what I wanted.

Thanks!
Image