📄 xgrouplabel.cs
字号:
namespace Imps.Client.Pc.Controls
{
using System;
using System.Drawing;
using System.Windows.Forms;
public class XGroupLabel : XLabel1
{
public XGroupLabel()
{
base.TextAlign = ContentAlignment.MiddleLeft;
}
protected override void OnPaintControl(PaintEventArgs e)
{
base.OnPaintControl(e);
if (base.TextAlign == ContentAlignment.MiddleLeft)
{
Size size = Size.Ceiling(e.Graphics.MeasureString(this.Text, this.Font));
size.Width += 2;
Rectangle rectangle = Rectangle.FromLTRB(e.ClipRectangle.Left + size.Width, e.ClipRectangle.Top + (e.ClipRectangle.Height / 2), e.ClipRectangle.Right, (e.ClipRectangle.Top + (e.ClipRectangle.Height / 2)) + 2);
ControlPaint.DrawBorder3D(e.Graphics, rectangle);
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -