>xxx.Visible := False;

>I do not know what to use in place of "xxx".  The code is as follows and
there
>is one form with a button and two units - all with default names.


>Chrissy.

Simply put the 
  MyList1: TMyList;

declaration into the TForm1 dclaration, then you can access it using
MyList1.

IE:

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  ComCtrls, StdCtrls, unit2;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    MyList1 : TMyList;
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
begin
  MyList1 := TMyList.Create(Self);
  MyList1.Parent := Form1;
  MyList1.Items.AddChildFirst(nil,MyList1.Name);
  MyList1.Name := 'TreeView';
  MyList1.Visible := True;
  MyList1.Items.AddChildFirst(nil,MyList1.Name);
  MyList1.SendToBack;
end;

end.


unit Unit2;

interface

uses
  ComCtrls, Controls, Classes;

type
  TMyList = class(TCustomTreeView)
  public
    constructor Create(AOwner: TComponent);
  published
    property Items;
  end;

implementation

constructor TMyList.Create(AOwner: TComponent);
begin
  inherited Create(Owner);  // Initialize inherited parts
  Align := alLeft;
end;

end.


---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"

Reply via email to