DarkSeparator control

This commit is contained in:
Robin 2015-09-18 10:33:51 +01:00
parent 7e7cf7c9f2
commit 784e3b69b7
3 changed files with 48 additions and 1 deletions

View File

@ -0,0 +1,44 @@
using System.Drawing;
using System.Windows.Forms;
namespace DarkUI
{
public class DarkSeparator : Control
{
#region Constructor Region
public DarkSeparator()
{
SetStyle(ControlStyles.Selectable, false);
Dock = DockStyle.Top;
Size = new Size(1, 2);
}
#endregion
#region Paint Region
protected override void OnPaint(PaintEventArgs e)
{
var g = e.Graphics;
using (var p = new Pen(Colors.DarkBorder))
{
g.DrawLine(p, ClientRectangle.Left, 0, ClientRectangle.Right, 0);
}
using (var p = new Pen(Colors.LightBorder))
{
g.DrawLine(p, ClientRectangle.Left, 1, ClientRectangle.Right, 1);
}
}
protected override void OnPaintBackground(PaintEventArgs e)
{
// Absorb event
}
#endregion
}
}

View File

@ -52,6 +52,9 @@
<Compile Include="Controls\DarkScrollBar.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Controls\DarkSeparator.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Controls\DarkStatusStrip.cs">
<SubType>Component</SubType>
</Compile>

View File

@ -526,7 +526,7 @@
//
this.toolStripStatusLabel6.Margin = new System.Windows.Forms.Padding(0, 0, 50, 2);
this.toolStripStatusLabel6.Name = "toolStripStatusLabel6";
this.toolStripStatusLabel6.Size = new System.Drawing.Size(261, 14);
this.toolStripStatusLabel6.Size = new System.Drawing.Size(230, 14);
this.toolStripStatusLabel6.Spring = true;
this.toolStripStatusLabel6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//