My older system: Win2k, VS2005(Academic), .Net 2.0 SP1.
Windows.Forms Application: Two splitter panels, a TreeView (named:
"tree") in one panel populated with directory name nodes.
Logic for programmatically selecting a previously saved FullPath is
being called from the tree.Enter() event handler;
After expanding to a specific folder and selecting it (for testing
purposes I chose a specific folder that is level 4 depth) ... I
observe a difference between tabbing into the tree control and mouse
clicking into it. I have placed the following line at the beginning of
the Enter event handler:
Console.Writeline("tree.SelectedNode = {0}", tree.SelectedNode);
----------------------------------------------------
The problem >>>
When I tab into the tree control, above line output is:
tree.SelectedNode =
When I click into the tree control, the output is:
tree.SelectedNode = TreeNode: G:\
----------------------------------------------------
The "G" drive is correct for the folder selected. This subtle little
SelectedNode value difference is wreaking havoc on my code that
programmatically selects a previously saved folder location.
I've tried a variety of guesses aimed at gaining some control and
understanding of what is going on ... but all of them are failures and
discussing them only confuses the issue. :(
I might eventually stumble onto a novice programmer level solution ...
but I'd be so much better off understanding what is going on and how
to properly control the property settings of the TreeView object.
Specific guidance to the above problem would be wonderful !!
Additional TreeView advice or example code on programmatic selection
would be equally appreciated. Suggested texts, links, etc. I'm not
lazy ... but perhaps as evidenced from the hours I've spent searching
and the days of confusion this has caused me it is fair to say I'm not
exactly "gifted". ;)
** Thanks in advance for any help !! **
-- Tom