Source/Editors/VisualLabel.cs
(开头部分) 1KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
#if FRAMEWORK20
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using DevComponents.DotNetBar;
namespace DevComponents.Editors
{
public class VisualLabel : VisualItem
{
#region Private Variables
#endregion
#region Events
#endregion
#region Constructor
#endregion
#region Internal Implementation
private string _Text = "";
/// <summary>
/// Gets or sets the text displayed by the label.
/// </summary>
public string Text
{
get { return _Text; }
set
{
if (value == null) value = "";
if (_Text != value)
{
_Text = value;
InvalidateArrange();
}
}
}
public override void PerformLayout(PaintInfo p)
{
Size size = Size.Empty;
Graphics g = p.Graphics;
Font font = p.DefaultFont;
eTextFormat textFormat = eTextFormat.Default | eTextFormat.LeftAndRightPadding;
if (_Text.Length > 0)
size = TextDrawing.MeasureString(g, Text, font, 0, textFormat);
this.Size = size;
base.PerformLayout(p);
}
protected override void OnPaint(PaintInfo p)
{
Graphics g = p.Graphics;
Font font = p.DefaultFont;
Rectangle r = this.RenderBounds;
eTextFormat textFormat = eTextFormat.Default;
Color color = p.ForeColor;
后面还有 12 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。