Allora, ho fatto le seguenti modifiche la tuo programma, sono andato in file è ho cliccato "Nuova form" che ha la Unit di nome Unit1 con la form che si chiama Form2.
Ecco il codice per fare quello che volevi tu:
unit MdiPrincipale;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls
, Unit1
;
type
{ TForm1 }
TForm1 = class(TForm)
TreeView1: TTreeView;
procedure FormCreate(Sender: TObject);
procedure TreeView1Click(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.FormCreate(Sender: TObject);
var
RootNode: TTreeNode;
begin
RootNode:=treeView1.Items.AddFirst(nil,'Home');
Treeview1.Items.Add (RootNode,'Archivi');
Treeview1.Items.AddChild(Treeview1.Items.GetLastNode,'Clienti');
Treeview1.Items.Add (RootNode,'Contabilita');
Treeview1.Items.Add (RootNode,'Magazzino');
RootNode.Expanded:=true;
// come aggiungo ad 'Archivi' la voce Clienti?
// ed al doppio click su 'Clienti' come faccio a fare partire qualcosa?
end;
procedure TForm1.TreeView1Click(Sender: TObject);
begin
if Treeview1.Selected.Text='Clienti' then
begin
Form2.Show;
end;
end;
end.
Spero ti sia stato utile.