You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.1 KiB

using Sunny.UI;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace MorClient
{
public class LabelUserContro: UILabel
{
/// <summary>
/// 自定义边框颜色
/// </summary>
public Color BorderColor { get; set; }
protected override void WndProc(ref Message m)
{
base.WndProc(ref m);
if (m.Msg == 0xf || m.Msg == 0x133)
{
if (this.BorderStyle == BorderStyle.None)
{
System.Drawing.Pen pen = new Pen(this.BorderColor, 1);
Graphics g = Graphics.FromHwnd(m.HWnd);
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
g.DrawRectangle(pen, 0, 0, this.Width - 1, this.Height - 1);
pen.Dispose();
}
//返回结果
m.Result = IntPtr.Zero;
}
}
}
}