Skip to content

Commit 5f5f4d5

Browse files
committed
完成TCP连接类型参数控件改造。
1 parent bfa28f2 commit 5f5f4d5

File tree

3 files changed

+301
-7
lines changed

3 files changed

+301
-7
lines changed

QpTestClient/Controls/ClientOptions/ClientOptionsControlUtils.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ public static void BindInt32(TextBox textBox, Func<int?> getValueHandler, Action
4444
};
4545
}
4646

47+
public static void BindBoolean(CheckBox checkBox, Func<bool> getValueHandler, Action<bool> setValueHandler)
48+
{
49+
checkBox.Checked = getValueHandler();
50+
checkBox.CheckedChanged += (sender2, e2) => setValueHandler(checkBox.Checked);
51+
}
52+
4753
private static void ActiveLabel(Label label)
4854
{
4955
label.ForeColor = SystemColors.HighlightText;
@@ -56,14 +62,13 @@ private static void DeactiveLabel(Label label)
5662
label.BackColor = SystemColors.ControlLightLight;
5763
}
5864

59-
public static void LinkControl(Label label, TextBox control)
65+
public static void LinkControl(Label label, Control control)
6066
{
6167
label.Click += (sender, e) =>
6268
{
6369
ActiveLabel(label);
6470
if (!control.Focused)
6571
{
66-
control.SelectionStart = control.Text.Length;
6772
control.Focus();
6873
}
6974
};

QpTestClient/Controls/ClientOptions/TcpClientOptionsControl.Designer.cs

Lines changed: 279 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)