Please Help Me Understand This Bizarre Tree Entry Observation



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





.



Relevant Pages

  • Re: Questions about event handling with Ttk::treeview
    ... have a look at the demo of the treeview. ... Listboxes and Trees->A Directory Tree browser. ... Selecting another item, even without holding down the Shift or Ctrl ... model for the treeview widget. ...
    (comp.lang.tcl)
  • Re: MMC
    ... the tree opens if I right click on the services.msc file and select author. ... and selecting author brings up the one I don't want. ... The wrong one retains its author privileges through a restart. ... >> disabled services, but Norton has reported one exploit two days ago, ...
    (microsoft.public.windowsxp.general)
  • How to unSelect a JTree??
    ... selecting a set of paths (with the usual and ... Windows icon selection: when the user clicks on the ... I figured out how to perform the actual unselection: ... The only Tree Listener seems to be 'valueChanged' ...
    (comp.lang.java.programmer)
  • Questions about event handling with Ttk::treeview
    ... I'm trying to write a small Tcl/Tk app with a treeview widget for selecting multiple files and directories in the filesystem. ... Some other GUI toolkits have a "checkbox tree" kind of widget that behaves this way. ... I can keep track of the currently selected items in a variable... ...
    (comp.lang.tcl)
  • Re: Programmatically Selecting a Node
    ... > I am programmatically selecting a node in my tree as follows: ... Does the tree view have focus? ... is the HideSelection property set to ... Prev by Date: ...
    (microsoft.public.vb.controls)