L li__lu Unregistered / Unconfirmed GUEST, unregistred user! 2002-11-03 #1 在Form1上自定义了一个过程 Form1.procedure setting(); 在Form1.button1click中直接调用不了 应当如何解决?
D del520 Unregistered / Unconfirmed GUEST, unregistred user! 2002-11-03 #2 先申明在 private中 Procedure Seting(); 然后 Tform1.Procedure setting(); begin end;
X xianjun Unregistered / Unconfirmed GUEST, unregistred user! 2002-11-03 #5 都不知你在等待什么! 调用不了出什么错? 就象下面这样,没有调用不了的。[] unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } procedure setting(); public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); begin Setting; end; procedure TForm1.setting; begin ShowMessage('My Setting() Procedure!'); end; end.
都不知你在等待什么! 调用不了出什么错? 就象下面这样,没有调用不了的。[] unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } procedure setting(); public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); begin Setting; end; procedure TForm1.setting; begin ShowMessage('My Setting() Procedure!'); end; end.
G goease Unregistered / Unconfirmed GUEST, unregistred user! 2002-11-03 #6 不是啦,加入过程名称是setting 在Form1中。那么 声明 public procedure setting; implementation TForm1.procedure setting; begin end;
不是啦,加入过程名称是setting 在Form1中。那么 声明 public procedure setting; implementation TForm1.procedure setting; begin end;
M maplesw Unregistered / Unconfirmed GUEST, unregistred user! 2002-11-06 #11 如果过程的参数没错的话,先换个名称,xianjun的方法再试
P panjf Unregistered / Unconfirmed GUEST, unregistred user! 2002-11-06 #12 过程定义错了吧 >>Form1.procedure setting(); 应该这样写 procedure TForm1.Setting;