diff --git a/Bin/SunnyUI.dll b/Bin/SunnyUI.dll index 263c45c6..796d3459 100644 Binary files a/Bin/SunnyUI.dll and b/Bin/SunnyUI.dll differ diff --git a/Bin/SunnyUI.pdb b/Bin/SunnyUI.pdb index 2ccffad7..474f674f 100644 Binary files a/Bin/SunnyUI.pdb and b/Bin/SunnyUI.pdb differ diff --git a/SunnyUI.Demo/Bin/SunnyUI.Demo.exe b/SunnyUI.Demo/Bin/SunnyUI.Demo.exe index 0ccfc3d1..24fe3f28 100644 Binary files a/SunnyUI.Demo/Bin/SunnyUI.Demo.exe and b/SunnyUI.Demo/Bin/SunnyUI.Demo.exe differ diff --git a/SunnyUI.Demo/Bin/SunnyUI.dll b/SunnyUI.Demo/Bin/SunnyUI.dll index 263c45c6..796d3459 100644 Binary files a/SunnyUI.Demo/Bin/SunnyUI.dll and b/SunnyUI.Demo/Bin/SunnyUI.dll differ diff --git a/SunnyUI.Demo/Forms/FDialogs.cs b/SunnyUI.Demo/Forms/FDialogs.cs index 20ee1d17..2fd25c65 100644 --- a/SunnyUI.Demo/Forms/FDialogs.cs +++ b/SunnyUI.Demo/Forms/FDialogs.cs @@ -15,11 +15,11 @@ namespace Sunny.UI.Demo { if (this.ShowAskDialog("确认信息提示框")) { - UIMessageTip.ShowOk("您点击了确定按钮"); + this.ShowSuccessTip("您点击了确定按钮"); } else { - UIMessageTip.ShowError("您点击了取消按钮"); + this.ShowErrorTip("您点击了取消按钮"); } } @@ -49,6 +49,7 @@ namespace Sunny.UI.Demo for (int i = 0; i < 100; i++) { SystemEx.Delay(50); + StatusDescription = "数据加载中(" + i + "%)......"; StatusStepIt(); } } diff --git a/SunnyUI/Forms/UIFormHelper.cs b/SunnyUI/Forms/UIFormHelper.cs index 1cc1a6c7..629f1aa2 100644 --- a/SunnyUI/Forms/UIFormHelper.cs +++ b/SunnyUI/Forms/UIFormHelper.cs @@ -21,6 +21,8 @@ ******************************************************************************/ using System.Collections; +using System.ComponentModel; +using System.Drawing; using System.Windows.Forms; namespace Sunny.UI @@ -446,4 +448,115 @@ namespace Sunny.UI ShowNotifier(desc, UINotifierType.ERROR, UILocalize.ErrorTitle, false, timeout); } } + + public static class UIMessageTipHelper + { + /// + /// 显示消息 + /// + /// 窗体 + /// 消息文本 + /// 消息样式。不指定则使用默认样式 + /// 消息停留时长(ms)。为负时使用全局时长 + /// 是否漂浮,不指定则使用全局设置 + /// 消息窗显示位置。不指定则智能判定,当由工具栏项(ToolStripItem)弹出时,请指定该参数或使用接收控件的重载 + /// 是否以point参数为中心进行呈现。为false则是在其附近呈现 + public static void ShowInfoTip(this Form form, string text, TipStyle style = null, int delay = -1, bool? floating = null, + Point? point = null, bool centerByPoint = false) + => UIMessageTip.Show(text, style, delay, floating, point, centerByPoint); + + /// + /// 在指定控件附近显示消息 + /// + /// 窗体 + /// 控件或工具栏项 + /// 消息文本 + /// 消息样式。不指定则使用默认样式 + /// 消息停留时长(ms)。为负时使用全局时长 + /// 是否漂浮,不指定则使用全局设置 + /// 是否在控件中央显示,不指定则自动判断 + public static void ShowInfoTip(this Form form, Component controlOrItem, string text, TipStyle style = null, int delay = -1, + bool? floating = null, bool? centerInControl = null) + => UIMessageTip.Show(controlOrItem, text, style, delay, floating, centerInControl); + + + /// + /// 在指定控件附近显示出错消息 + /// + /// 窗体 + /// 控件或工具栏项 + /// 消息文本 + /// 消息停留时长(ms)。默认1秒,若要使用全局时长请设为-1 + /// 是否漂浮。默认不漂浮。若要使用全局设置请设为null + /// 是否在控件中央显示,不指定则自动判断 + public static void ShowErrorTip(this Form form, Component controlOrItem, string text = null, int delay = 1000, + bool? floating = null, bool? centerInControl = null) + => UIMessageTip.ShowError(controlOrItem, text, delay, floating, centerInControl); + + /// + /// 显示出错消息 + /// + /// 窗体 + /// 消息文本 + /// 消息停留时长(ms)。默认1秒,若要使用全局时长请设为-1 + /// 是否漂浮。默认不漂浮。若要使用全局设置请设为null + /// 消息窗显示位置。不指定则智能判定,当由工具栏项(ToolStripItem)弹出时,请指定该参数或使用接收控件的重载 + /// 是否以point参数为中心进行呈现。为false则是在其附近呈现 + public static void ShowErrorTip(this Form form, string text = null, int delay = 1000, bool? floating = null, Point? point = null, + bool centerByPoint = false) + => UIMessageTip.ShowError(text, delay, floating, point, centerByPoint); + + /// + /// 在指定控件附近显示良好消息 + /// + /// 窗体 + /// 控件或工具栏项 + /// 消息文本 + /// 消息停留时长(ms)。为负时使用全局时长 + /// 是否漂浮,不指定则使用全局设置 + /// 是否在控件中央显示,不指定则自动判断 + public static void ShowSuccessTip(this Form form, Component controlOrItem, string text = null, int delay = -1, bool? floating = null, + bool? centerInControl = null) + => UIMessageTip.ShowOk(controlOrItem, text, delay, floating, centerInControl); + + + /// + /// 显示良好消息 + /// + /// 窗体 + /// 消息文本 + /// 消息停留时长(ms)。为负时使用全局时长 + /// 是否漂浮,不指定则使用全局设置 + /// 消息窗显示位置。不指定则智能判定,当由工具栏项(ToolStripItem)弹出时,请指定该参数或使用接收控件的重载 + /// 是否以point参数为中心进行呈现。为false则是在其附近呈现 + public static void ShowSuccessTip(this Form form, string text = null, int delay = -1, bool? floating = null, Point? point = null, + bool centerByPoint = false) + => UIMessageTip.ShowOk(text, delay, floating, point, centerByPoint); + + /// + /// 在指定控件附近显示警告消息 + /// + /// 窗体 + /// 控件或工具栏项 + /// 消息文本 + /// 消息停留时长(ms)。默认1秒,若要使用全局时长请设为-1 + /// 是否漂浮。默认不漂浮。若要使用全局设置请设为null + /// 是否在控件中央显示,不指定则自动判断 + public static void ShowWarningTip(this Form form, Component controlOrItem, string text = null, int delay = 1000, + bool? floating = null, bool? centerInControl = null) + => UIMessageTip.ShowWarning(controlOrItem, text, delay, floating, centerInControl); + + /// + /// 显示警告消息 + /// + /// 窗体 + /// 消息文本 + /// 消息停留时长(ms)。默认1秒,若要使用全局时长请设为-1 + /// 是否漂浮。默认不漂浮。若要使用全局设置请设为null + /// 消息窗显示位置。不指定则智能判定,当由工具栏项(ToolStripItem)弹出时,请指定该参数或使用接收控件的重载 + /// 是否以point参数为中心进行呈现。为false则是在其附近呈现 + public static void ShowWarningTip(this Form form, string text = null, int delay = 1000, bool? floating = null, Point? point = null, + bool centerByPoint = false) + => UIMessageTip.ShowWarning(text, delay, floating, point, centerByPoint); + } } \ No newline at end of file diff --git a/Updates.txt b/Updates.txt index 3a124854..db6f0175 100644 --- a/Updates.txt +++ b/Updates.txt @@ -1,6 +1,7 @@ + ӣ - ɾ * ޸ 2020.06.21 ++ UIMessageTipHelperMessageTipչ + UILoginForm¼ͼƬ * UIMessageFormDemoϢڵˢ˸Bug