Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1026485
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T12:05:25+00:00 2026-05-16T12:05:25+00:00

TreeNode desktop = new TreeNode(); desktop.Text = Desktop; desktop.Tag = Desktop; Mycomputer.ImageIndex = 1;

  • 0
TreeNode desktop = new TreeNode();
desktop.Text = "Desktop";
desktop.Tag = "Desktop";
Mycomputer.ImageIndex = 1;
Mycomputer.SelectedImageIndex = 1;
desktop.Nodes.Add("");
treeView1.Nodes.Add(desktop);

TreeNode Mycomputer = new TreeNode("My Computer");
Mycomputer.ImageIndex = 1;
Mycomputer.SelectedImageIndex = 1;
treeView1.Nodes.Add(Mycomputer);

I am using the ImageIndex property but where is the image?

How do I choose my image and from where?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T12:05:26+00:00Added an answer on May 16, 2026 at 12:05 pm

    For ImageIndex to have any meaning, your tree view should have an ImageList assigned. The ImageIndex property refers to the index within the image list of the image you want to present.

    You can create an ImageList manually, or via the designer. This example demonstrates a method of creating and assigning an ImageList manually:

    http://msdn.microsoft.com/en-us/library/system.windows.forms.treeview.imagelist.aspx

    For me, I just pop open the designer, select the tree view, find the ImageList property in the property editor, and click it to launch a popup window that allows me to select and import a set of resources that become the image list.

    Here are some screenshots of the process:

    The ImageList component can be dragged onto your form from the toolbox.

    Screen01

    It has an Images collection among its properties.

    Screen02

    With the image list on the form, you can select it for the ImageList property on your tree view.

    Screen03

    I hope that helps fill some of the gaps.

    Good luck!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

A TreeNode class has Text Name Tag I need to assign more values to
I use JTree with TreeNode which extending DefaultMutableTreeNode.when I add new node,i cant update
Im using following code: TreeNode i = treeView1.SelectedNode; RefillTree(); //clears the tree and rebuilt
I am trying to add a custom icon near the text of a TreeNode,
TreeNode[] nodes = this.treeview.Nodes.Find(node.Text, true); if (nodes.Length > 0) { int i = nodes[0].Index;
I created this simple tree: var children = [{ text:'My Layers', children:[ new Ext.tree.TreeNode({text:'test1',leaf:true}),
I am trying to inherit from TreeNode to add own nodes to TreeView: class
i already have a project with TreeNode class which creates a hierachy of nodes
How can I change a color of some part of treenode Text ? For
Here is the application on codeplex all i did is created a new text

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.