Tech Off Thread

5 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Set Icons for the Windows Forms TreeView Control

Back to Forum: Tech Off
  • User profile image
    Ion Todirel

    Hey guys,

    How can i set icons for TreeView without using a ImageList? I guess i can't? [C]



  • User profile image
    Mike Dimmick

    The Windows Forms TreeView control is a pretty thin wrapper over the Win32 TreeView control. That control uses the Win32 ImageList control, which is wrapped by the Windows Forms ImageList. There's no other way to set the icons.

  • User profile image

    If you really want to do that, you can always draw the control yourself

  • User profile image
    Ion Todirel

    why's that? for TreeView i understand why but for ListView. How can i obtain a graphics handle for each item in Tree or List View?

    So MS guys, why you decide that is no need to set items icon directly, without ImageList?

  • User profile image

    I guess the question is, why not just use an imagelist? You can create that on the fly or at design time, either way. Just create it in code, add one image and you are good to go.

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.