* UITextBox: 增加对按钮设置ToolTip

This commit is contained in:
Sunny 2022-04-11 17:53:40 +08:00
parent 57c83b2b1b
commit f3058c2d5d
2 changed files with 15 additions and 0 deletions

View File

@ -32,6 +32,7 @@
* 2022-01-07: V3.1.0
* 2022-02-16: V3.1.1
* 2022-03-14: V3.1.1
* 2022-04-11: V3.1.3 ToolTip
******************************************************************************/
using System;
@ -119,6 +120,11 @@ namespace Sunny.UI
TextAlignmentChange += UITextBox_TextAlignmentChange;
}
public void SetButtonToolTip(ToolTip toolTip, string tipText)
{
toolTip.SetToolTip(btn, tipText);
}
/// <summary>
/// 填充颜色,当值为背景色或透明色或空值则不填充
/// </summary>

View File

@ -71,6 +71,15 @@ namespace Sunny.UI
[DefaultValue(typeof(Size), "100, 70"), Description("不自动缩放时大小"), Category("SunnyUI")]
public Size Size { get; set; } = new Size(100, 70);
public new void SetToolTip(Control control, string caption)
{
base.SetToolTip(control, caption);
if (control is IToolTip toolTip)
{
base.SetToolTip(toolTip.ExToolTipControl(), caption);
}
}
public void SetToolTip(Control control, string caption, string title, int symbol, int symbolSize,
Color symbolColor)
{