Fix Nodes auto-closing right after expanding via Right key. (#2021)
Fix Nodes not saving Expanded when opening or closing via Left and Right key.
This commit is contained in:
@@ -937,8 +937,6 @@ public sealed partial class MainForm : Form
|
||||
|
||||
if (!backgroundUpdater.IsBusy)
|
||||
backgroundUpdater.RunWorkerAsync();
|
||||
|
||||
RestoreCollapsedNodeState(treeView);
|
||||
}
|
||||
|
||||
private void SaveConfiguration()
|
||||
@@ -1360,6 +1358,28 @@ public sealed partial class MainForm : Form
|
||||
treeView.Columns[0].Width = newWidth;
|
||||
}
|
||||
|
||||
private void TreeView_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (treeView.SelectedNode != null)
|
||||
{
|
||||
switch (e.KeyCode)
|
||||
{
|
||||
case Keys.Right:
|
||||
if (treeView.SelectedNode.Tag is IExpandPersistNode expandPersistNodeR)
|
||||
{
|
||||
expandPersistNodeR.Expanded = true;
|
||||
}
|
||||
return;
|
||||
case Keys.Left:
|
||||
if (treeView.SelectedNode.Tag is IExpandPersistNode expandPersistNodeL)
|
||||
{
|
||||
expandPersistNodeL.Expanded = false;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void TreeView_ColumnWidthChanged(TreeColumn column)
|
||||
{
|
||||
int index = treeView.Columns.IndexOf(column);
|
||||
|
||||
Reference in New Issue
Block a user