How to set an image to a TreeNode in VIBlend TreeView for WinForms?
|
Article Information
|
Article relates to VIBlend TreeView for WinForms
|
How To
|
Set an image to a TreeNode
|
Solution
|
In order to achieve this, you need to do the following:
|
1. Drag and drop a new instance of the vTreeView control or create it programmatically.
|
2. Create a new instance of the ImageList component and fill it with images by using its Images property.
|
3. Add tree nodes by using the Add method of the TreeView Nodes collection.
|
4. Create a new ImageList, add images to it and associate it to the vTreeView instance by using the ImageList property.
|
5. Use the vTreeNode ImageIndex property in order to associate an image from the ImageList. In addition, you can use the SelectedImageIndex property that will set an image to the TreeNode when it is selected, or the StateImageIndex property that will set an image to the TreeNode when it is expanded.
|
|
|