In have a TreeView
in my C#
application and I need a SelectedNodeChanged
event in winform like the one in WebControls
I've read this question and its answers about using Control.MouseUp
and TreeView.AfterSelect
events, But its just not the right thing to do (e.g the one OP mentions in that question)
Control.MouseUp? They must be kidding. What if the tree is being navigating with keys instead of the mouse?
I tried to create my own TreeView
, But I don't really know how to create a real event for SelectedNodeChanged
.
public partial class MyTreeView : TreeView
{
public MyTreeView()
{
InitializeComponent();
}
//How to add event here?
}