各位大哥,我在程序中创建了 三个窗体 form1,form2,form3 
我想在按 F1键时 form1弹出,按F2键时 form2弹出,按F3键时 form3 弹出,
应该怎么做,谢谢!!马上给分

解决方案 »

  1.   

    看你什么要求了?如果是在任何时候都实现那就得使用HotKey如果只在自己的程序中实现,那这个问题就没有必要再问了,自己琢磨一下!
      

  2.   

    对不起啊,F1,F2,F3的键值,我不记得了 你只要在keydown事件里判断按下的是否是这几个键值,showmodal就可以了
      

  3.   

    tedit1.onkeydown(....);
    begin
       if key=vk_f1 then begin
         form1:=TForm1.Create(self):
         from1.showmodal;
         from1.free;
    end;
    end;
      

  4.   

    vk_F1  虚拟键值112vk_f2  113.
    .
    .
      

  5.   

    在控件的onkeydown中写:
    if key=112 then form1.show;
    if key=113 then form2.show;
    if key=114 then form3.show;
      

  6.   

    wisenowa(127.0.0.1) 说得对,我是要求在任何时候都能够 激发的,而不是仅仅在自己程序中 激发的。
      

  7.   

    如果是在任何时候都实现   那就得使用HotKey
      

  8.   

    以下是一个按键地勾子: Intercepting The TAB and ENTER Keys {the prototype for the new keyboard hook function} function KeyboardHook(nCode: Integer;wParam: WPARAM; lParam: LPARAM): LResult;stdcall; var Form1: TForm1; WinHook: HHOOK;// a handle to the keyboard hook function implementation {$R *.DFM} procedure TForm1.FormCreate(Sender: TObject); begin {install the keyboard hook function into the keyboard hook chain} WinHook:=SetWindowsHookEx(WH_KEYBOARD, @KeyboardHook, 0, GetCurrentThreadID); end; procedure TForm1.FormDestroy(Sender: TObject); begin {remove the keyboard hook function from the keyboard hook chain} UnhookWindowsHookEx(WinHook); end; function KeyboardHook(nCode: Integer;wParam: WPARAM;lParam: LPARAM): LResult; begin {if we can process the hook information...} if (nCode>-1) then {...was the TAB key pressed?} if (wParam=VK_TAB) then begin {if so, output a beep sound} MessageBeep(0); {indicate that the message was processed} Result := 1; end else {...was the RETURN key pressed?} if (wParam=VK_RETURN) then begin {if so, and if the key is on the up stroke, cause the focus to move to the next control} if ((lParam shr 31)=1) then Form1.Perform(WM_NEXTDLGCTL, 0, 0); {indicate that the message was processed} Result := 1; end else {otherwise, indicate that the message was not processed.} Result := 0 else {we must pass the hook information to the next hook in the chain} Result := CallNextHookEx(WinHook, nCode, wParam, lParam); end; 
      

  9.   

    加一个actionlist
    双击->new action (三次)
    点击一个action->shortcut 选f1(其它类似)
    双击action1写事件form2.show;
    清楚吗?
      

  10.   

    bluespy(先迈左脚,还是右脚 ?非常感谢!