Go Back   Wiki NewForum | Latest Entertainment News > Career Forum & Tips > Tech Forum & Tutorial > Oracle Database, SQL, Application, Programming


Do you have Hot Keys?


Reply
Views: 1311  
Thread Tools Rate Thread
  #1  
Old 08-11-2010, 02:35 PM
bholas bholas is offline
Award Winner
 
Join Date: Apr 2010
Posts: 4,977
Default Do you have Hot Keys?

Defining and handling hot keys is very easy:
  • Set your form's "KeyPreview" property to "True."


    KeyPreview := True;
  • Define your form's "KeyDown" event. For example, following code will catch any CTRL+F1 [hot] key presses:


    procedure TForm1.FormKeyDown(
    Sender: TObject; var Key: Word;
    Shift: TShiftState );
    begin
    if( (ssCtrl in Shift) and
    (Key = VK_F1) )then
    begin
    // do your thing here...
    MessageBox( Handle,
    'F1 pressed!',
    'Hot Key',
    MB_OK );
    end;
    end;


Reply With Quote
Reply

Tags
pc tips

New topics in Oracle Database, SQL, Application, Programming





Powered by vBulletin® Version 3.8.10
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
WikiNewForum)