Control TTreeView
Publicado: Mar May 08, 2007 7:24 am
Hola a todos, tengo un problema con el objeto ttreeview. Si utilizo la
forma de descrita en el ejemplo TreeView que es la de primero insertar
la imagenes y despues insertar los item, todo funciona correctamente,
tal y como viene el Method Tvcreate:
METHOD TVCreate( oSender ) CLASS TForm1
local oItem
WITH OBJECT oSender
:InsertImage("printer")
:InsertImage("database")
:InsertItem("First item at the root", 1 )
:InsertItem("Second item at the root", 1)
oItem := :InsertItem("Third item at the root",2, ,.T.)
oItem:InsertItem("Item after third item",1)
oItem:InsertItem("Another item after third item",2)
:ExpandAll()
END
RETURN Nil
Sin embargo, si utilizo la forma de insertintem y en esta incluyo el
bitmap, muestra las imagenes cambiadas, en el primer item aparece en vez
de printer un database . El ejemplo anterior quedaria de la siguiente forma:
METHOD TVCreate( oSender ) CLASS TForm1
local oItem
WITH OBJECT oSender
:InsertItem("First item at the root", "printer" )
:InsertItem("Second item at the root", "printer")
oItem := :InsertItem("Third item at the root", "database", ,.T.)
oItem:InsertItem("Item after third item", "printer")
oItem:InsertItem("Another item after third item", "database" )
:ExpandAll()
END
RETURN Nil
¿Estoy haciendo algo mal?
forma de descrita en el ejemplo TreeView que es la de primero insertar
la imagenes y despues insertar los item, todo funciona correctamente,
tal y como viene el Method Tvcreate:
METHOD TVCreate( oSender ) CLASS TForm1
local oItem
WITH OBJECT oSender
:InsertImage("printer")
:InsertImage("database")
:InsertItem("First item at the root", 1 )
:InsertItem("Second item at the root", 1)
oItem := :InsertItem("Third item at the root",2, ,.T.)
oItem:InsertItem("Item after third item",1)
oItem:InsertItem("Another item after third item",2)
:ExpandAll()
END
RETURN Nil
Sin embargo, si utilizo la forma de insertintem y en esta incluyo el
bitmap, muestra las imagenes cambiadas, en el primer item aparece en vez
de printer un database . El ejemplo anterior quedaria de la siguiente forma:
METHOD TVCreate( oSender ) CLASS TForm1
local oItem
WITH OBJECT oSender
:InsertItem("First item at the root", "printer" )
:InsertItem("Second item at the root", "printer")
oItem := :InsertItem("Third item at the root", "database", ,.T.)
oItem:InsertItem("Item after third item", "printer")
oItem:InsertItem("Another item after third item", "database" )
:ExpandAll()
END
RETURN Nil
¿Estoy haciendo algo mal?