unit Unit1;

interface

uses
 Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
 Dialogs, StdCtrls;

type
 TForm1 = class(TForm)
   Button1: TButton;
   procedure TForm1.add_notify(Sender: TObject);  //声明
   procedure FormCreate(Sender: TObject);
 private
   { Private declarations }
 public
   { Public declarations }
 end;

var
 Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.add_notify(Sender: TObject);
begin
showmessage('ddddd');
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
button1.onClick:=add_notify;   //赋事件,不需要添加参数
end;

end.

相关文章:

  • 2022-12-23
  • 2021-12-13
  • 2023-03-04
  • 2022-02-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-08-27
  • 2022-12-23
  • 2021-06-30
  • 2021-09-22
  • 2021-08-23
  • 2022-12-23
相关资源
相似解决方案