Help w/ TreeView and Images

  • Thread starter Thread starter John Bowman
  • Start date Start date
J

John Bowman

Hello,

I'm tyring to understand something about using a TreeView ctrl & assigning
the images. For testing purposes I'm just using the VS IDE to create and
assign the contents of the TreeView. When I add a Node I can set the Image,
and or the Selected Image properties for that node. Normally, when a user
interacts with a TreeView (assume the directory style folders), the icon is
a closed folder when collapsed, and when selected. However, it becomes an
open folder image when the user actually opens the node by clicking on the
"+". Doesn't this require a 3rd image to be assigned? How can I get this
same type of behavior when there's only 2 settings? What am I missing here?

TIA,
 
Hello,

You can extend the TreeView control's functionality programatically.
E.g., if you want to use the 3d image for the expanded nodes you could do
something like that:
- handle the AfterExpand event and change the TreeNode's ImageIndex
property to your 3d image
- handle the AfterCollapse event and change the TreeNode's ImageIndex back
to the default image

Hello,

I'm tyring to understand something about using a TreeView ctrl & assigning
the images. For testing purposes I'm just using the VS IDE to create and
assign the contents of the TreeView. When I add a Node I can set the Image,
and or the Selected Image properties for that node. Normally, when a user
interacts with a TreeView (assume the directory style folders), the icon is
a closed folder when collapsed, and when selected. However, it becomes an
open folder image when the user actually opens the node by clicking on the
"+". Doesn't this require a 3rd image to be assigned? How can I get this
same type of behavior when there's only 2 settings? What am I missing here?

TIA,

--
John C. Bowman
Software Engineer
Thermo Electron Scientific Instruments Div.
<Remove this before reply> (e-mail address removed)

Regards,

Adrian Vinca [MSFT], Developer Division
--------------------------------------------------------------------
This reply is provided "AS IS", without warranty (express or implied).

Note: For the benefit of the community-at-large, all responses to this
message are best directed to the newsgroup/thread from which they
originated.
 
Adrian,

Thanks for the idea. I'll give it a try and see what happens.

John

Adrian Vinca said:
Hello,

You can extend the TreeView control's functionality programatically.
E.g., if you want to use the 3d image for the expanded nodes you could do
something like that:
- handle the AfterExpand event and change the TreeNode's ImageIndex
property to your 3d image
- handle the AfterCollapse event and change the TreeNode's ImageIndex back
to the default image

Hello,

I'm tyring to understand something about using a TreeView ctrl & assigning
the images. For testing purposes I'm just using the VS IDE to create and
assign the contents of the TreeView. When I add a Node I can set the Image,
and or the Selected Image properties for that node. Normally, when a user
interacts with a TreeView (assume the directory style folders), the icon is
a closed folder when collapsed, and when selected. However, it becomes an
open folder image when the user actually opens the node by clicking on the
"+". Doesn't this require a 3rd image to be assigned? How can I get this
same type of behavior when there's only 2 settings? What am I missing here?

TIA,

--
John C. Bowman
Software Engineer
Thermo Electron Scientific Instruments Div.
<Remove this before reply> (e-mail address removed)

Regards,

Adrian Vinca [MSFT], Developer Division
--------------------------------------------------------------------
This reply is provided "AS IS", without warranty (express or implied).

Note: For the benefit of the community-at-large, all responses to this
message are best directed to the newsgroup/thread from which they
originated.
 
Back
Top