侵蚀一下如下程序,是否能大道理的要求
unit FCForm;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ComCtrls, StdCtrls, Mask;
type
TForm1 = class(TForm)
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
StatusBar1: TStatusBar;
Button1: TButton;
Memo1: TMemo;
RadioButton1: TRadioButton;
MaskEdit1: TMaskEdit;
procedure Button1Click(Sender: TObject);
procedure Button1KeyPress(Sender: TObject;
var Key: Char);
public
procedure CmFocusChanged (var Msg: TCmFocusChanged);
message cm_FocusChanged;
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.CmFocusChanged (var Msg: TCmFocusChanged);
begin
if msg.Sender.name='Memo1' then
begin
button1.SetFocus;
if button1.Focused then
showmessage('gkfhjg');
end;
StatusBar1.SimpleText := Msg.Sender.Name;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
showmessage('gfjg');
end;
procedure TForm1.Button1KeyPress(Sender: TObject;
var Key: Char);
begin
if key=#13 then
button1click(self);
end;
end.