优化SearchComboBox

This commit is contained in:
ChsBuffer
2020-09-10 17:02:46 +08:00
parent c9527e8671
commit 04fd88ea3c
3 changed files with 126 additions and 92 deletions

View File

@@ -65,6 +65,7 @@ namespace Netch.Forms
ModeComboBox.Items.Clear();
ModeComboBox.Items.AddRange(Global.Modes.ToArray());
ModeComboBox.Tag = null;
SelectLastMode();
_comboBoxInitialized = comboBoxInitialized;
}

View File

@@ -23,6 +23,18 @@ namespace Netch.Forms
// 监听电源事件
SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged;
ModeComboBox.KeyUp += (sender, args) =>
{
switch (args.KeyData)
{
case Keys.Escape:
{
SelectLastMode();
return;
}
}
};
CheckForIllegalCrossThreadCalls = false;
}