unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
Memo1: TMemo;
procedure Memo1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
private
{ Private declarations }
procedure WMMenuChar(var MessageRec: TWMMenuChar); message WM_MENUCHAR;
public
{ Public declarations }
IgnoreMenuChar: boolean;
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.WMMenuChar(var MessageRec: TWMMenuChar);
begin
inherited;
if IgnoreMenuChar then
begin
MessageRec.Result := MakeLong( 0, 1 );
IgnoreMenuChar := False;
end;
end;
procedure TForm1.Memo1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if (SSALT in SHIFT) and (CHR(KEY) in ['A','a']) then
begin
key := 0;
IgnoreMenuChar := True;
Memo1.Text := '뭐야?';
end;
end;
end.
아~ 주석을 달아 놓는다는 것이 그만... 쩝...
Memo1KeyDown 이벤트 핸들러에서...
IgnoreMenuChar := True; 요 부분이 Beep음을 Kill하는 부분입니다.
쉽게 이해가 되실거에요...
그럼...