示例代码:
   
   
   parent code:
           ................
           Type
           TForm1=class(TForm)
                panel1 : TPanel;
                Panel2 : TPanel;
                Panel3 : TPanel;
             ........
            End.
    Child code;
       在这里有3个按扭,利用3个按扭来控制panel1..3的显示,应该如何来做?
    谢谢~!~!

解决方案 »

  1.   

    在子窗体里面uses父窗体procedure TChildForm.Button1Click(Sender: TObject);
    begin
      Form1.Panel1.Visble:=not Form1.Panel1.Visble;
    end;
      

  2.   

    上面的Visble写错了,下面的代码绝对可以
    implementation
    uses unit1;
    {$R *.dfm}procedure TForm2.Button1Click(Sender: TObject);
    begin
      Form1.Panel1.Visible:=not Form1.Panel1.Visible;
    end;
      

  3.   

    在TChileForm的Private中声明:
      fTFatherForm :TForm1;
    然后在你的程序中就能调用TForm1中的Panel了.