-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
1,116 additions
and
215 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -236,4 +236,4 @@ _Pvt_Extensions | |
.fake/ | ||
|
||
# DIY | ||
/History/* | ||
**/History/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using System.Windows.Forms; | ||
|
||
namespace BFR.WinApp.ControlInvoke | ||
{ | ||
/// <summary> | ||
/// CheckBoxInvoke | ||
/// </summary> | ||
public class CheckBoxInvoke | ||
{ | ||
/// <summary> | ||
/// 获取选择按钮选中状态委托 | ||
/// </summary> | ||
/// <param name="Ctrl"></param> | ||
private delegate bool GetCheckBoxCheckedDelegate(CheckBox Ctrl); | ||
/// <summary> | ||
/// 设置选择按钮选中状态委托 | ||
/// </summary> | ||
/// <param name="Ctrl"></param> | ||
/// <param name="Checked"></param> | ||
private delegate void SetCheckBoxCheckedDelegate(CheckBox Ctrl, bool Checked); | ||
|
||
/// <summary> | ||
/// 获取选择按钮选中状态方法 | ||
/// </summary> | ||
/// <param name="Ctrl"></param> | ||
private static bool GetCheckBoxCheckedFunc(CheckBox Ctrl) | ||
{ | ||
return Ctrl.Checked; | ||
} | ||
|
||
/// <summary> | ||
/// 获取选择按钮选中状态 | ||
/// </summary> | ||
/// <param name="Ctrl"></param> | ||
/// <returns></returns> | ||
public static bool GetCheckBoxChecked(CheckBox Ctrl) | ||
{ | ||
return (bool)Ctrl.Invoke(new GetCheckBoxCheckedDelegate(GetCheckBoxCheckedFunc), new object[] { Ctrl }); | ||
} | ||
|
||
/// <summary> | ||
/// 设置选择按钮选中状态方法 | ||
/// </summary> | ||
/// <param name="Ctrl"></param> | ||
/// <param name="Checked"></param> | ||
private static void SetCheckBoxCheckedFunc(CheckBox Ctrl, bool Checked) | ||
{ | ||
Ctrl.Checked = Checked; | ||
Ctrl.Refresh(); | ||
} | ||
|
||
/// <summary> | ||
/// 设置选择按钮选中状态 | ||
/// </summary> | ||
/// <param name="Ctrl"></param> | ||
/// <param name="Checked"></param> | ||
public static void SetCheckBoxChecked(CheckBox Ctrl, bool Checked) | ||
{ | ||
Ctrl.Invoke(new SetCheckBoxCheckedDelegate(SetCheckBoxCheckedFunc), new object[] { Ctrl, Checked }); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,213 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using System.Windows.Forms; | ||
|
||
namespace BFR.WinApp.ControlInvoke | ||
{ | ||
public class Invokes | ||
{ | ||
#region //Controls | ||
|
||
#region // TextBox | ||
/// <summary> | ||
/// 设置文本框文本 | ||
/// </summary> | ||
/// <param name="Ctrl"></param> | ||
/// <param name="Text"></param> | ||
public static void SetTextBoxText(TextBox Ctrl, string Text) | ||
{ | ||
TextBoxInvoke.SetTextBoxText(Ctrl, Text); | ||
} | ||
|
||
/// <summary> | ||
/// 获取文本框文本方法 | ||
/// </summary> | ||
/// <param name="Ctrl"></param> | ||
public static string GetTextBoxText(TextBox Ctrl) | ||
{ | ||
return TextBoxInvoke.GetTextBoxText(Ctrl); ; | ||
} | ||
#endregion | ||
|
||
#region // Label | ||
/// <summary> | ||
/// 设置标签文本 | ||
/// </summary> | ||
/// <param name="Ctrl"></param> | ||
/// <param name="Text"></param> | ||
public static void SetLabelText(Label Ctrl, string Text) | ||
{ | ||
LabelInvoke.SetLabelText(Ctrl, Text); | ||
} | ||
|
||
/// <summary> | ||
/// 获取标签文本方法 | ||
/// </summary> | ||
/// <param name="Ctrl"></param> | ||
public static string GetLabelText(Label Ctrl) | ||
{ | ||
return LabelInvoke.GetLabelText(Ctrl); ; | ||
} | ||
#endregion | ||
|
||
#region // RadioButton | ||
/// <summary> | ||
/// 获取单选按钮选中状态 | ||
/// </summary> | ||
/// <param name="Ctrl"></param> | ||
/// <returns></returns> | ||
public static bool GetRadioButtonChecked(RadioButton Ctrl) | ||
{ | ||
return RadioButtonInvoke.GetRadioButtonChecked(Ctrl); | ||
} | ||
|
||
/// <summary> | ||
/// 设置单选按钮选中状态 | ||
/// </summary> | ||
/// <param name="Ctrl"></param> | ||
/// <param name="Checked"></param> | ||
public static void SetRadioButtonChecked(RadioButton Ctrl, bool Checked) | ||
{ | ||
RadioButtonInvoke.SetRadioButtonChecked(Ctrl, Checked); | ||
} | ||
#endregion | ||
|
||
#region // CheckBox | ||
/// <summary> | ||
/// 获取选择按钮选中状态 | ||
/// </summary> | ||
/// <param name="Ctrl"></param> | ||
/// <returns></returns> | ||
public static bool GetCheckBoxChecked(CheckBox Ctrl) | ||
{ | ||
return CheckBoxInvoke.GetCheckBoxChecked(Ctrl); | ||
} | ||
|
||
/// <summary> | ||
/// 设置选择按钮选中状态 | ||
/// </summary> | ||
/// <param name="Ctrl"></param> | ||
/// <param name="Checked"></param> | ||
public static void SetCheckBoxChecked(CheckBox Ctrl, bool Checked) | ||
{ | ||
CheckBoxInvoke.SetCheckBoxChecked(Ctrl, Checked); | ||
} | ||
#endregion | ||
|
||
#region // ProgressBar | ||
/// <summary> | ||
/// 获取进度条值 | ||
/// </summary> | ||
/// <param name="Ctrl"></param> | ||
public static int GetProgressBarValue(ProgressBar Ctrl) | ||
{ | ||
return ProgressBarInvoke.GetProgressBarValue(Ctrl); | ||
} | ||
/// <summary> | ||
/// 设置进度条值 | ||
/// </summary> | ||
/// <param name="Ctrl"></param> | ||
/// <param name="Value"></param> | ||
public static void SetProgressBarValue(ProgressBar Ctrl, int Value) | ||
{ | ||
ProgressBarInvoke.SetProgressBarValue(Ctrl, Value); | ||
} | ||
|
||
/// <summary> | ||
/// 获取进度条最小值 | ||
/// </summary> | ||
/// <param name="Ctrl"></param> | ||
public static int GetProgressBarMinValue(ProgressBar Ctrl) | ||
{ | ||
return ProgressBarInvoke.GetProgressBarMinValue(Ctrl); | ||
} | ||
/// <summary> | ||
/// 设置进度条最小值 | ||
/// </summary> | ||
/// <param name="Ctrl"></param> | ||
/// <param name="Value"></param> | ||
public static void SetProgressBarMinValue(ProgressBar Ctrl, int Value) | ||
{ | ||
ProgressBarInvoke.SetProgressBarMinValue(Ctrl, Value); | ||
} | ||
|
||
/// <summary> | ||
/// 获取进度条最大值 | ||
/// </summary> | ||
/// <param name="Ctrl"></param> | ||
public static int GetProgressBarMaxValue(ProgressBar Ctrl) | ||
{ | ||
return ProgressBarInvoke.GetProgressBarMaxValue(Ctrl); | ||
} | ||
/// <summary> | ||
/// 设置进度条最大值 | ||
/// </summary> | ||
/// <param name="Ctrl"></param> | ||
/// <param name="Value"></param> | ||
public static void SetProgressBarMaxValue(ProgressBar Ctrl, int Value) | ||
{ | ||
ProgressBarInvoke.SetProgressBarMaxValue(Ctrl, Value); | ||
} | ||
#endregion | ||
|
||
#endregion | ||
|
||
#region // Common | ||
|
||
#region // Visible | ||
/// <summary> | ||
/// 获取控件是否可见委托 | ||
/// </summary> | ||
/// <param name="Ctrl"></param> | ||
private delegate bool GetControlVisibleDelegate(Control Ctrl); | ||
/// <summary> | ||
/// 设置控件是否可见委托 | ||
/// </summary> | ||
/// <param name="Ctrl"></param> | ||
/// <param name="Visible"></param> | ||
private delegate void SetControlVisibleDelegate(Control Ctrl, bool Visible); | ||
|
||
/// <summary> | ||
/// 获取控件是否可见方法 | ||
/// </summary> | ||
/// <param name="Ctrl"></param> | ||
private static bool GetControlVisibleFunc(Control Ctrl) | ||
{ | ||
return Ctrl.Visible; | ||
} | ||
|
||
/// <summary> | ||
/// 获取控件是否可见 | ||
/// </summary> | ||
/// <param name="flag"></param> | ||
public static bool GetControlVisible(Control Ctrl) | ||
{ | ||
return (bool)Ctrl.Invoke(new SetControlVisibleDelegate(SetControlVisibleFunc), new object[] { Ctrl }); | ||
} | ||
|
||
/// <summary> | ||
/// 设置控件是否可见方法 | ||
/// </summary> | ||
/// <param name="Ctrl"></param> | ||
/// <param name="Visible"></param> | ||
private static void SetControlVisibleFunc(Control Ctrl, bool Visible) | ||
{ | ||
Ctrl.Visible = Visible; | ||
Ctrl.Refresh(); | ||
} | ||
|
||
/// <summary> | ||
/// 设置控件是否可见 | ||
/// </summary> | ||
/// <param name="Ctrl"></param> | ||
/// <param name="Visible"></param> | ||
public static void SetControlVisible(Control Ctrl, bool Visible) | ||
{ | ||
Ctrl.Invoke(new SetControlVisibleDelegate(SetControlVisibleFunc), new object[] { Ctrl, Visible }); | ||
} | ||
#endregion | ||
|
||
#endregion | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using System.Windows.Forms; | ||
|
||
namespace BFR.WinApp.ControlInvoke | ||
{ | ||
/// <summary> | ||
/// LabelInvoke | ||
/// </summary> | ||
public class LabelInvoke | ||
{ | ||
/// <summary> | ||
/// 获取标签文本委托 | ||
/// </summary> | ||
/// <param name="Ctrl"></param> | ||
private delegate string GetLabelTextDelegate(Label Ctrl); | ||
/// <summary> | ||
/// 设置标签文本委托 | ||
/// </summary> | ||
/// <param name="Ctrl"></param> | ||
/// <param name="Text"></param> | ||
private delegate void SetLabelTextDelegate(Label Ctrl, string Text); | ||
|
||
/// <summary> | ||
/// 获取标签文本方法 | ||
/// </summary> | ||
/// <param name="Ctrl"></param> | ||
private static string GetLabelTextFunc(Label Ctrl) | ||
{ | ||
return Ctrl.Text; | ||
} | ||
|
||
/// <summary> | ||
/// 获取标签文本 | ||
/// </summary> | ||
/// <param name="Ctrl"></param> | ||
/// <returns></returns> | ||
public static string GetLabelText(Label Ctrl) | ||
{ | ||
return (string)Ctrl.Invoke(new GetLabelTextDelegate(GetLabelTextFunc), new object[] { Ctrl }); | ||
} | ||
|
||
/// <summary> | ||
/// 设置标签文本方法 | ||
/// </summary> | ||
/// <param name="Ctrl"></param> | ||
/// <param name="Text"></param> | ||
private static void SetLabelTextFunc(Label Ctrl, string Text) | ||
{ | ||
Ctrl.Text = Text; | ||
Ctrl.Refresh(); | ||
} | ||
|
||
/// <summary> | ||
/// 设置标签文本 | ||
/// </summary> | ||
/// <param name="Ctrl"></param> | ||
/// <param name="Text"></param> | ||
public static void SetLabelText(Label Ctrl, string Text) | ||
{ | ||
Ctrl.Invoke(new SetLabelTextDelegate(SetLabelTextFunc), new object[] { Ctrl, Text }); | ||
} | ||
} | ||
} |
Oops, something went wrong.