Add Subitem TreeView1 Estilo ListView1 ?

Delphi

28/03/2009

Como adicionar subitems no treeview1 estilo o listview1 ?

Abraços...


Warfighter

Warfighter

Curtidas 0

Respostas

Warfighter

Warfighter

28/03/2009

como adicionar childs no listview ?


GOSTEI 0
Woinch

Woinch

28/03/2009

  ListItem := ListView1.Items.Add; 
  ListItem.Caption := ´TEXTO´; 
  ListItem.SubItems.Add(´SUBITEM´); 
  ListItem.SubItems.Add(´SUBITEM´);



GOSTEI 0
Warfighter

Warfighter

28/03/2009

é estilo raiz fomando uma arvore a apartir do caption :(

como fazer isso ?

é estilo o treeview :shock:


GOSTEI 0
Woinch

Woinch

28/03/2009

Desculpe, troquei as bolas! :D
Veja o exemplo retirado do help do delphi:

  with TreeView1.Items do
  begin
    Clear; { remove any existing nodes }
    MyTreeNode1 := Add(nil, ´RootTreeNode1´); { Add a root node }
    { Add a child node to the node just added }
    AddChild(MyTreeNode1,´ChildNode1´);

    {Add another root node}
    MyTreeNode2 := Add(MyTreeNode1, ´RootTreeNode2´);
    {Give MyTreeNode2 to a child }
    AddChild(MyTreeNode2,´ChildNode2´);

    {Change MyTreeNode2 to ChildNode2 }
    { and add a child node to it}
    MyTreeNode2 := TreeView1.Items[3];
    AddChild(MyTreeNode2,´ChildNode2a´);

    {Add another child to ChildNode2, after ChildNode2a }
    Add(MyTreeNode2,´ChildNode2b´);

    {add another root node}
    Add(MyTreeNode1, ´RootTreeNode3´);
  end;


Acho que é isso que você quer né? Qualquer dúvida é só responder.
Obrigado.


GOSTEI 0
POSTAR