adcionar subitems em um treeview

Delphi

17/01/2004

Olá pessoal, alguem sabe como posso adcionar um subitem em um treeview por exemplo ao cliclar em um botâo.

Ex: na hora em q o form abre ele tem um treview com um item, depois eu clico em um botão e ele coloca um subitem neste item.

Valeu


Oadventista

Oadventista

Curtidas 0

Respostas

Vinicius2k

Vinicius2k

17/01/2004

colega,

vc precisa se utilizar dos métodos add e addchild... numa treeview vazia por exemplo :


 with treeview1 do
  begin
   // raiz
   items.Add(nil,´Item 1´);
   // filhos do item 1
   items.AddChild(items[0],´Sub-Item 1.1´);
   items.AddChild(items[0],´Sub-Item 1.2´);
   items.AddChild(items[0],´Sub-Item 1.3´);
   items.AddChild(items[0],´Sub-Item 1.4´);
  end;


espero ter ajudado...


GOSTEI 0
POSTAR