This commit is contained in:
Sunny 2024-11-19 09:46:37 +08:00
parent 7e6ee8e98b
commit 1708d57ef1
3 changed files with 4 additions and 18 deletions

View File

@ -73,7 +73,7 @@ namespace Sunny.UI
tip.Visible = false;
}
protected readonly UITransparentPanel tip = new UITransparentPanel();
internal readonly UITransparentPanel tip = new UITransparentPanel();
private UIChartStyleType chartStyleType = UIChartStyleType.Plain;
[DefaultValue(UIChartStyleType.Plain)]

View File

@ -983,7 +983,7 @@ namespace Sunny.UI
using Graphics g = this.CreateGraphics();
using var TempFont = Font.DPIScaleFont(UIStyles.DefaultSubFontSize);
Size sf = TextRenderer.MeasureText(sb.ToString(), TempFont);
tip.Size = new Size(sf.Width + 4, sf.Height + 4);
tip.Size = new Size(sf.Width + 4, sf.Height + 10);
int x = e.Location.X + 15;
int y = e.Location.Y + 20;

View File

@ -6,28 +6,14 @@ using System.Windows.Forms;
namespace Sunny.UI
{
[ToolboxItem(false)]
public class UITransparentPanel : UIPanel
internal class UITransparentPanel : UIPanel
{
private int _opacity = 150;
public UITransparentPanel()
{
Opacity = 200;
SetStyleFlags(true, false);
}
[Bindable(true), Category("Custom"), DefaultValue(150), Description("背景的透明度. 有效值0-255")]
public int Opacity
{
get { return _opacity; }
set
{
if (value > 255) value = 255;
else if (value < 0) value = 0;
_opacity = value;
Invalidate();
}
}
protected override CreateParams CreateParams
{
get