方法1:将自定义过程procedure Test(str: String);放到private后,程序中定义如下:TForm.procedure Test(str: String);
方法2:在 var  Form1: TForm1;后定义的,写法如下:FormName.ButtonName.Caption:='';

解决方案 »

  1.   

    调用出什么错呀?
    你可以把本过程放到form的声明中就不用在button.Caption前加Form了
      

  2.   

    procedure tform1.Test(str: String);
      begin
        Button1.Caption:=str;
      end;
    //其他地方调用Test('hello')
    没问题呀
      

  3.   

    procedure Tform1.Test(str: String);
      begin
        Button.Caption:=str;
      end;
    同意楼上的意见!!
      

  4.   

    to: liuaiken(aiken)
    方法1:将自定义过程procedure Test(str: String);放到private后,程序中定义如下:TForm.procedure Test(str: String);
      

  5.   

    没必要做为窗体类的成员,因为无法识别,加上所属的窗体类名即可!如:
    procedure Test(str: String);
    begin
      Form.Button.Caption:=str;
    end;把鼠标放在Test上,看看提示和窗体类成员的提示有何不同?知道为什么要这样做了?