DotNet 4.8.1 build of DotNetBar

This commit is contained in:
2025-02-07 10:35:23 -05:00
parent 33439b63a0
commit 6b0a5d60f4
2609 changed files with 989814 additions and 7 deletions

View File

@@ -0,0 +1,50 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
namespace DevComponents.DotNetBar.Layout
{
/// <summary>
/// Represents the item used as empty spacer element.
/// </summary>
public class LayoutSpacerItem : LayoutItemBase
{
#region Constructor
#endregion
#region Implementation
protected override void OnPaintBackground(PaintContext context)
{
base.OnPaintBackground(context);
if (this.DesignMode && !this.IsSelected && this.Bounds.Width > 0 && this.Bounds.Height > 0)
{
using (Pen borderPen = this.DesignTimeBorderPen)
{
Rectangle clientRectangle = this.Bounds;
clientRectangle.Width--;
clientRectangle.Height--;
context.Graphics.DrawRectangle(borderPen, clientRectangle);
}
}
}
protected Pen DesignTimeBorderPen
{
get
{
Color color = (SystemColors.Control.GetBrightness() < 0.5) ? ControlPaint.Light(SystemColors.Control) : ControlPaint.Dark(SystemColors.Control);
LayoutControl lc = GetLayoutControl();
if (lc != null)
color = (lc.BackColor.GetBrightness() < 0.5) ? ControlPaint.Light(lc.BackColor) : ControlPaint.Dark(lc.BackColor);
Pen pen = new Pen(color);
pen.DashStyle = DashStyle.Dash;
return pen;
}
}
#endregion
}
}