TreeView strange behaviour how to.

  • Thread starter Thread starter Jacek Jurkowski
  • Start date Start date
J

Jacek Jurkowski

TreeView Control:

If I click using left mouse button on a TreeNode it gets blue
and SelectedNodeproperty is Changing - Ok. But if I click on
it using right mouse button node is getting blue but SelectedNode
propery is not changing. So user think's trat he is on node f.e. 3
cause it's color is blue but program is using SelectedNode f.e. 0
for any acctions ... How to solve/disable this?
 
Hi Jacek,
TreeView Control:

If I click using left mouse button on a TreeNode it gets blue
and SelectedNodeproperty is Changing - Ok. But if I click on
it using right mouse button node is getting blue but SelectedNode
propery is not changing. So user think's trat he is on node f.e. 3
cause it's color is blue but program is using SelectedNode f.e. 0
for any acctions ... How to solve/disable this?

In MouseDown event handler use the TreeView method
GetNodeAt(...) to select that node.

If You're using ContextMenu and if this handling occures
after menu's show then i can recommend you to use
ContextMenu.Show(...) method.

Cheers!/Pozdrowienia!

Marcin
 
Back
Top