16,748
社区成员
发帖
与我相关
我的任务
分享
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
//这个类可以放到其他单元
TMyClass = class
private
public
procedure Show;
end;
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
{ TMyClass }
procedure TMyClass.Show;
begin
ShowMessage('ok');
end;
procedure TForm1.Button1Click(Sender: TObject);
var
my:TMyClass;
begin
my := TMyClass.Create;
my.Show;
end;
end.