treeview (urgente)

Delphi

18/07/2003

estou tentando fazer com que os (nó) do treeview quando selecionado mostre o tabcontrol

treeview tabcontrol

no1 tabcontrol1
no2 tabcontrol2

Entao quando o (no1) for selecionado exibir o tabcontrol1, quando o (no2) for selecionado exibir o tabcontrol2 e assim por diante


Edinydia

Edinydia

Curtidas 0

Respostas

Allan

Allan

18/07/2003

Não sei se entendi , mas vc pode fazer isso identificando o level (nível) do seu treeview , e fazer por exemplo no evento OnChanging do Treeview o seguinte :

procedure TForm1.TreeView1Changing(Sender: TObject; Node: TTreeNode;
var AllowChange: Boolean);
begin
if Node.Level = 0 then
PageControl1.ActivePageIndex := 0
else
if Node.Level = 1 then
PageControl1.ActivePageIndex := 1;

end;


GOSTEI 0
POSTAR