T
Tom
I have your classic WinForm treeview that uses an image list with 2 images:
1. An open folder.
2. A closed folder.
The events that I have registered for are:
1. afterselect
2. afterexpand
3. aftercollapse
The AfterExpand and AfterCollapse events set the imageindex appropriately,
and seems to be working fine. However, here's my prob:
If I expand a folder, and then click a subdirectory under that folder, and
then go back and click on the parent folder (which is still expanded) the
folder icon reverts back to the closed folder icon, when it should still be
the open folder icon.
I know the afterexpand and aftercollapse events do not get fired.
AfterSelect of course gets fired, but after stepping through the code, the
TreeNode has the appropriate image index (1) at the beginning and end of the
function right before it returns.
My TreeNode's are not exactly TreeNode's of the TreeNode class. I created
my own class that derives from TreeNode and has an ArrayList inside of it.
I can't imagine that the inheritance is screwing this up somehow, but that's
my guess at this point.
Can anybody see something that I'm doing wrong?
Thanks.
1. An open folder.
2. A closed folder.
The events that I have registered for are:
1. afterselect
2. afterexpand
3. aftercollapse
The AfterExpand and AfterCollapse events set the imageindex appropriately,
and seems to be working fine. However, here's my prob:
If I expand a folder, and then click a subdirectory under that folder, and
then go back and click on the parent folder (which is still expanded) the
folder icon reverts back to the closed folder icon, when it should still be
the open folder icon.
I know the afterexpand and aftercollapse events do not get fired.
AfterSelect of course gets fired, but after stepping through the code, the
TreeNode has the appropriate image index (1) at the beginning and end of the
function right before it returns.
My TreeNode's are not exactly TreeNode's of the TreeNode class. I created
my own class that derives from TreeNode and has an ArrayList inside of it.
I can't imagine that the inheritance is screwing this up somehow, but that's
my guess at this point.
Can anybody see something that I'm doing wrong?
Thanks.