-
Notifications
You must be signed in to change notification settings - Fork 216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
自定义波特率BUG #184
Comments
⚠ 你的Issue可能缺少了一些信息,请自觉补全,以证明issue内容的真实性: ⚠ Your issue may be missing some information, please complete it to prove the authenticity of the content of the issue:
|
将原来的SelectionChanged事件处理替换为DropDownOpened事件和DropDownClosed事件 private void BaudRateComboBox_DropDownClosed(object sender, EventArgs e)
{
if (baudRateComboBox.SelectedItem != null)
{
if (baudRateComboBox.SelectedIndex == baudRateComboBox.Items.Count - 1)
{
int br = 0;
Tuple<bool, string> ret = Tools.InputDialog.OpenDialog(TryFindResource("ShowBaudRate") as string ?? "?!",
"115200", TryFindResource("OtherRate") as string ?? "?!");
if (ret.Item1 && int.TryParse(ret.Item2, out br))
{
Tools.Global.setting.baudRate = br;
}
Task.Run(() =>
{
this.Dispatcher.Invoke(new Action(delegate {
var text = Tools.Global.setting.baudRate.ToString();
baudRateComboBox.Items[baudRateComboBox.Items.Count - 1] = text;
baudRateComboBox.Text = text;
}));
});
}
else
{
Tools.Global.setting.baudRate =
int.Parse((baudRateComboBox.SelectedItem as ComboBoxItem).Content.ToString());
baudRateComboBox.Items[baudRateComboBox.Items.Count - 1] = TryFindResource("OtherRate") as string ?? "?!";
}
}
}
private void BaudRateComboBox_DropDownOpened(object sender, EventArgs e)
{
baudRateComboBox.Items[baudRateComboBox.Items.Count - 1] = TryFindResource("OtherRate") as string ?? "?!";
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
描述一下这个bug / Describe the bug
1、选择自定义波特率时,弹出波特率设置窗口,选择取消的时候会出现两个错误提示窗
2、选择自定义波特率时,修改完成后,无法再二次自定义波特率。
复现步骤 / To Reproduce
选择自定义波特率
预期的行为 / Expected behavior
1、一般情况下,选择取消按钮时不应该有任何错误提示。
2、当自定义波特率修改完成后,应该还需要可以再次自定义
截图 / Screenshots
No response
日志 / Logs
No response
系统 / System
Windows 10
软件版本 / Version
1.1.3.3
验证
The text was updated successfully, but these errors were encountered: