Fixes #31
This commit is contained in:
parent
fb310e303b
commit
46ad1ccf38
@ -151,6 +151,9 @@ public partial class SectionTree : UserControl
|
||||
// Ensure, that the added node is visible and gets the focus:
|
||||
node.EnsureVisible();
|
||||
this.treeView.SelectedNode = node;
|
||||
|
||||
// Fire the click event:
|
||||
this.treeView_NodeMouseClick(this, new TreeNodeMouseClickEventArgs(node, MouseButtons.Left, 1, 0, 0));
|
||||
}
|
||||
|
||||
private async void buttonRemove_Click(object sender, EventArgs e)
|
||||
@ -178,6 +181,12 @@ public partial class SectionTree : UserControl
|
||||
|
||||
// Reload the tree:
|
||||
this.LoadNodes(this, EventArgs.Empty);
|
||||
|
||||
// Select the first root node:
|
||||
this.treeView.SelectedNode = this.treeView.Nodes.Count > 0 ? this.treeView.Nodes[0] : null;
|
||||
|
||||
// Fire the click event:
|
||||
this.treeView_NodeMouseClick(this, new TreeNodeMouseClickEventArgs(this.treeView.SelectedNode!, MouseButtons.Left, 1, 0, 0));
|
||||
}
|
||||
|
||||
private async void treeView_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
|
||||
|
Loading…
Reference in New Issue
Block a user