Icone no treeview

13/07/2004

0

Gostaria de saber como aplico um ícone nos itens de um treeview em tempo de execução. Antecipo que o ícone fisicamente não existe. Eu recebo o handle através de uma API e o aplico a um objeto TIcon.
Tentei armezenar o mesmo em um imagelist, durante a execução, mas não consegui...


Thaleshcv

Thaleshcv

Responder

Post mais votado

01/12/2004

Thales,
eu uso na minha treeview, esse recurso de adicionar na imagelist em tempo de execução e funciona direitinho. Talvez o problema possa estar sendo a imagelist que vc adiciona o icone não estar relacionada com a treeview.


Gabriela

Gabriela
Responder

Mais Posts

13/07/2004

Motta

TCustomImageList.Add

TCustomImageListSee also

Adds an Image and its Mask to the image list object.

function Add(Image, Mask: TBitmap): Integer;

Description

Use the Add method to add images with their masks to an image list. It returns the index of the added image, or -1 if it fails. When the Masked property of the image list is False, the second bitmap handle is ignored; it can be set to nil.



TTreeNode.ImageIndex

TTreeNodeSee also

Specifies which image is displayed when a node is in its normal state and is not currently selected.

property ImageIndex: TImageIndex;


Description

Use the ImageIndex property with the Images property of the tree view to specify the image for the node in it’s normal state.

já tentou usar este par de met/prop ?


Responder

13/07/2004

Thaleshcv

TCustomImageList.Add TCustomImageListSee also Adds an Image and its Mask to the image list object. function Add(Image, Mask: TBitmap): Integer; Description Use the Add method to add images with their masks to an image list. It returns the index of the added image, or -1 if it fails. When the Masked property of the image list is False, the second bitmap handle is ignored; it can be set to nil. TTreeNode.ImageIndex TTreeNodeSee also Specifies which image is displayed when a node is in its normal state and is not currently selected. property ImageIndex: TImageIndex; Description Use the ImageIndex property with the Images property of the tree view to specify the image for the node in it’s normal state. já tentou usar este par de met/prop ?


tentei usar o metodo addicon do imagelist. mas o icone nao foi adicionado...


Responder

13/07/2004

Motta

Nunca fiz isto, na verdade foi um palpite.


Responder

25/08/2023

Alan

Thales,
eu uso na minha treeview, esse recurso de adicionar na imagelist em tempo de execução e funciona direitinho. Talvez o problema possa estar sendo a imagelist que vc adiciona o icone não estar relacionada com a treeview.


Gabriela Você teria um exemplo disso ,para me mostrar?
Responder

25/08/2023

Alan

Thales,
eu uso na minha treeview, esse recurso de adicionar na imagelist em tempo de execução e funciona direitinho. Talvez o problema possa estar sendo a imagelist que vc adiciona o icone não estar relacionada com a treeview.


Teria um exemplo disso para me mostrar?
Responder

Assista grátis a nossa aula inaugural

Assitir aula

Saiba por que programar é uma questão de
sobrevivência e como aprender sem riscos

Assistir agora

Utilizamos cookies para fornecer uma melhor experiência para nossos usuários, consulte nossa política de privacidade.

Aceitar