AJCooer
初階會員
![](./myimg/board/mystar.gif)
![](images/icon_photo_none.gif) 發表:48 回覆:52 積分:25 註冊:2004-02-12
發送簡訊給我
|
大家好
小弟一個程式中,有MainMenu, MainMenu中的每一個Item的ShotCut
都沒有F10這個Key,但是只要我一按F10這個Key,
它就會Focus在我的MainMenu中的File(MenuItem),
有沒有辦法讓這個F10不要作用,因為我沒有定義任何
ShortCut為F10 謝謝
|
m8815010
版主
![](./myimg/board/mystar.gif) ![](./myimg/board/mystar.gif) ![](./myimg/board/mystar.gif) ![](./myimg/board/mystar.gif)
![](images/icon_photo_none.gif) 發表:99 回覆:372 積分:289 註冊:2003-11-13
發送簡訊給我
|
引言:
大家好
小弟一個程式中,有MainMenu, MainMenu中的每一個Item的ShotCut
都沒有F10這個Key,但是只要我一按F10這個Key,
它就會Focus在我的MainMenu中的File(MenuItem),
有沒有辦法讓這個F10不要作用,因為我沒有定義任何
ShortCut為F10 謝謝
AJcooer你好 : 較快版,這是單純針對自已的這隻 class="code">Unit1.h
~~
class TForm1 : public TForm
{
__published: // IDE-managed Components
TMainMenu *MainMenu1;
TMenuItem *N1231;
TMenuItem *N2341;
TMenuItem *N3451;
private: // User declarations
TWndMethod OldFormWndProc; //add this line
void __fastcall FormWndProc(TMessage& Message); //add this line
public: // User declarations
__fastcall TForm1(TComponent* Owner);
}; Unit1.cpp ~~
TForm1 *Form1; //---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
OldFormWndProc=this->WindowProc;
this->WindowProc=FormWndProc;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormWndProc(TMessage& Message)
{
if (Message.Msg==WM_SYSCOMMAND && Message.WParam==SC_KEYMENU)
return; OldFormWndProc(Message);
}
All ! 發表人 -
|
AJCooer
初階會員
![](./myimg/board/mystar.gif)
![](images/icon_photo_none.gif) 發表:48 回覆:52 積分:25 註冊:2004-02-12
發送簡訊給我
|
|