* UIToolTip:更新ToolTip
This commit is contained in:
parent
eafc4ddab3
commit
99360a354c
BIN
Bin/SunnyUI.dll
BIN
Bin/SunnyUI.dll
Binary file not shown.
BIN
Bin/SunnyUI.pdb
BIN
Bin/SunnyUI.pdb
Binary file not shown.
Binary file not shown.
Binary file not shown.
5
SunnyUI.Demo/Controls/FButton.Designer.cs
generated
5
SunnyUI.Demo/Controls/FButton.Designer.cs
generated
@ -168,7 +168,7 @@
|
||||
this.uiButton1.StyleCustomMode = true;
|
||||
this.uiButton1.TabIndex = 0;
|
||||
this.uiButton1.Text = "White";
|
||||
this.uiButton1.TipsText = "White";
|
||||
this.uiToolTip1.SetToolTip(this.uiButton1, "White");
|
||||
//
|
||||
// uiButton2
|
||||
//
|
||||
@ -181,7 +181,7 @@
|
||||
this.uiButton2.StyleCustomMode = true;
|
||||
this.uiButton2.TabIndex = 1;
|
||||
this.uiButton2.Text = "Blue";
|
||||
this.uiButton2.TipsText = "Blue";
|
||||
this.uiToolTip1.SetToolTip(this.uiButton2, "Blue");
|
||||
//
|
||||
// uiButton3
|
||||
//
|
||||
@ -989,6 +989,7 @@
|
||||
// uiToolTip1
|
||||
//
|
||||
this.uiToolTip1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(54)))), ((int)(((byte)(54)))), ((int)(((byte)(54)))));
|
||||
this.uiToolTip1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.uiToolTip1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(239)))), ((int)(((byte)(239)))), ((int)(((byte)(239)))));
|
||||
this.uiToolTip1.OwnerDraw = true;
|
||||
this.uiToolTip1.ToolTipTitle = "ToolTip title";
|
||||
|
@ -6,6 +6,9 @@ using System.Windows.Forms;
|
||||
|
||||
namespace Sunny.UI
|
||||
{
|
||||
[ProvideProperty("ToolTip", typeof(Control))]
|
||||
[DefaultEvent("Popup")]
|
||||
[ToolboxItemFilter("System.Windows.Forms")]
|
||||
public class UIToolTip : ToolTip
|
||||
{
|
||||
private readonly ConcurrentDictionary<Control, ToolTipControl> ToolTipControls =
|
||||
@ -121,9 +124,9 @@ namespace Sunny.UI
|
||||
ToolTipControls.TryRemove(control, out _);
|
||||
}
|
||||
|
||||
public new ToolTipControl GetToolTip(Control control)
|
||||
public new string GetToolTip(Control control)
|
||||
{
|
||||
return ToolTipControls.ContainsKey(control) ? ToolTipControls[control] : new ToolTipControl();
|
||||
return ToolTipControls.ContainsKey(control) ? ToolTipControls[control].Description : "";
|
||||
}
|
||||
|
||||
private void InitOwnerDraw()
|
||||
|
Loading…
x
Reference in New Issue
Block a user