1怎么修改 button的颜色?(字体及背景)
修改button.font.color怎么没有用?2
function 不用定义吗?发现直接写到implementation就可以了3
begin
  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  Application.CreateForm(TForm2, Form2);
  Application.Run;
end.
为什么看不到form24
unit1.pas:
implementationfunction WF: Integer; 
begin
  ShowMessage('Hello World');
  Result := 1;
end;
//-------------------------------------------------------------
unit2.pas:
uses Unit1;
procedure TForm2.Button1Click(Sender: TObject);
var
    vvv: Integer ;
begin
    vvv:= Unit1.WF;//为什么不通过?
end;

解决方案 »

  1.   

    2、可以不定义,但是有局限,只能在本单元引用
      如果想在其他单元用,必须在public声明
    3、这时候form1是主窗体
      

  2.   

    4
    unit1.pas:
    function WF: Integer; ///////////////////
    implementationfunction WF: Integer; 
    begin
      ShowMessage('Hello World');
      Result := 1;
    end;
    //-------------------------------------------------------------
    unit2.pas:
    uses Unit1;
    procedure TForm2.Button1Click(Sender: TObject);
    var
        vvv: Integer ;
    begin
        vvv:= Unit1.WF;//ok 了
    end;
      

  3.   

    3
    begin
      Application.Initialize;
      Application.CreateForm(TForm1, Form1);
      Application.CreateForm(TForm2, Form2);
      form2.show;///////////////////////
      Application.Run;
    end.
      

  4.   

    2.可以不定义,只在本单元使用,并且使用它的函数和过程必须在它声明之后。
    3。form1是主窗体,当前只显示主窗体。
    4。WF只能在form1中使用
      

  5.   

    1、背景和字没法改的,至少 我不懂,呵呵,要不用其它的按钮怎么样?
    2、var
      DmMain: TDmMain;
      function IsDl(Icount:integer):boolean;//判断用户权限
      function xTOd(i:Real):string;//人民币大写转换
    implementation//我是这样的
    3、form2不是主窗口,要显示的话按楼上的说
      

  6.   

    先感谢其实我也试过定义,but....
    unit1.pas:
      public
        function WF: Integer;[Error] Unit1.pas(32): Unsatisfied forward or external declaration: 'TForm1.WF'This error message appears when you have a forward or external declaration of a procedure or function, or a declaration of a method in a class or object type, and you don't define the procedure, function or method anywhere.csdn真慢,时好时坏//the 6th time to reply
      

  7.   

    1、背景和字没法改的,至少 我不懂,呵呵,要不用其它的按钮怎么样?
    2、var
      DmMain: TDmMain;
      function IsDl(Icount:integer):boolean;//判断用户权限
      function xTOd(i:Real):string;//人民币大写转换
    implementation//我是这样的
    3、form2不是主窗口,要显示的话按楼上的说
      

  8.   

    to u2m:
    那么button.font.color有什么作用呢//你们的网速慢吗
      

  9.   

    ok,网速好的话马上结贴。
    over
      

  10.   

    2、可以不定义,但是有局限,只能在本单元引用
      如果想在其他单元用,必须在public声明
      

  11.   

    button.font.color设置Button字体的颜色,而不是背景色。
      

  12.   

    结贴后还有朋友回帖。。:修改button.font.color,没有反应。不过这个问题不重要了