I have two treeviews in my windows application and there is a button..
The button should be only visible when the user selects nodes from both the treeviews.
How can this be done.
Please help me
I have two treeviews in my windows application and there is a button.. The
Share
In both TreeViews look for the
AfterSelectevent. With the given event args (TreeViewEventArgs) you can find the node that is selected (or expended, etc.) withe.Node.You could set the same event handler method for both Treeviews.
Then set your button visibility like
this.MyButton.Visible = (this.MyTreeView1.SelectedNode != null && this.MyTreeView2.SelectedNode != null);Hope this helps!