I added offscreen drawing to OnPaint. At times I could see the individual dots being drawn
Other than that great control and thanks!
t
relavent code
<br />
protected override void OnPaint(PaintEventArgs e)<br />
{<br />
Graphics g = e.Graphics;<br />
<br />
Bitmap b = new Bitmap(ClientRectangle.Width,<br />
ClientRectangle.Height);<br />
Graphics bg = Graphics.FromImage(b);<br />
bg.Clear(this.BackColor);<br />
<br />
Rectangle r = this.ClientRectangle;
<br />
#region Vertical Splitter<br />
if(this.Dock == DockStyle.Left || this.Dock == DockStyle.Right)<br />
{<br />
rr = new Rectangle(r.X, (int)r.Y + ((r.Height - 115)/2), 8, 115);<br />
this.Width = 8;<br />
<br />
if(hot)<br />
{<br />
bg.FillRectangle(new SolidBrush(hotColor), new Rectangle(rr.X + 1, rr.Y, 6, 115));<br />
}<br />
else<br />
{<br />
bg.FillRectangle(new SolidBrush(this.BackColor), new Rectangle(rr.X + 1, rr.Y, 6, 115));<br />
}<br />
<br />
bg.DrawLine(new Pen(SystemColors.ControlDark, 1), rr.X + 1, rr.Y, rr.X + rr.Width - 2, rr.Y);<br />
bg.DrawLine(new Pen(SystemColors.ControlDark, 1), rr.X + 1, rr.Y + rr.Height, rr.X + rr.Width - 2, rr.Y + rr.Height);<br />
<br />
if(this.Enabled)<br />
{<br />
bg.FillPolygon(new SolidBrush(SystemColors.ControlDarkDark), ArrowPointArray(rr.X + 2, rr.Y + 3));<br />
bg.FillPolygon(new SolidBrush(SystemColors.ControlDarkDark), ArrowPointArray(rr.X + 2, rr.Y + rr.Height - 9));<br />
}<br />
<br />
int x = rr.X + 3;<br />
int y = rr.Y + 14;<br />
<br />
switch(visualStyle)<br />
{<br />
case VisualStyles.Mozilla:<br />
<br />
for(int i=0; i < 30; i++)<br />
{<br />
bg.DrawLine(new Pen(SystemColors.ControlLightLight), x, y + (i*3), x+1, y + 1 + (i*3));<br />
bg.DrawLine(new Pen(SystemColors.ControlDarkDark), x+1, y + 1 + (i*3), x+2, y + 2 + (i*3));<br />
if(hot)<br />
{<br />
bg.DrawLine(new Pen(hotColor), x+2, y + 1 + (i*3), x+2, y + 2 + (i*3));<br />
}<br />
else<br />
{<br />
bg.DrawLine(new Pen(this.BackColor), x+2, y + 1 + (i*3), x+2, y + 2 + (i*3));<br />
}<br />
}<br />
break;<br />
<br />
case VisualStyles.DoubleDots:<br />
for(int i=0; i < 30; i++)<br />
{<br />
bg.DrawRectangle(new Pen(SystemColors.ControlLightLight), x, y + 1 + (i*3), 1, 1 );<br />
bg.DrawRectangle(new Pen(SystemColors.ControlDark), x - 1, y +(i*3), 1, 1 );<br />
i++;<br />
bg.DrawRectangle(new Pen(SystemColors.ControlLightLight), x + 2, y + 1 + (i*3), 1, 1 );<br />
bg.DrawRectangle(new Pen(SystemColors.ControlDark), x + 1, y + (i*3), 1, 1 );<br />
}<br />
break;<br />
<br />
case VisualStyles.Win9x:<br />
<br />
bg.DrawLine(new Pen(SystemColors.ControlLightLight), x, y, x + 2, y);<br />
bg.DrawLine(new Pen(SystemColors.ControlLightLight), x, y, x,y + 90);<br />
bg.DrawLine(new Pen(SystemColors.ControlDark), x + 2, y, x + 2, y + 90);<br />
bg.DrawLine(new Pen(SystemColors.ControlDark), x, y + 90, x + 2, y + 90);<br />
break;<br />
<br />
case VisualStyles.XP:<br />
<br />
for(int i=0; i < 18; i++)<br />
{<br />
bg.DrawRectangle(new Pen(SystemColors.ControlLight), x, y + (i*5), 2, 2 );<br />
bg.DrawRectangle(new Pen(SystemColors.ControlLightLight), x + 1, y + 1 + (i*5), 1, 1 );<br />
bg.DrawRectangle(new Pen(SystemColors.ControlDarkDark), x, y +(i*5), 1, 1 );<br />
bg.DrawLine(new Pen(SystemColors.ControlDark), x, y + (i*5), x, y + (i*5) + 1);<br />
bg.DrawLine(new Pen(SystemColors.ControlDark), x, y + (i*5), x + 1, y + (i*5));<br />
}<br />
break;<br />
<br />
case VisualStyles.Lines:<br />
<br />
for(int i=0; i < 44; i++)<br />
{<br />
bg.DrawLine(new Pen(SystemColors.ControlDark), x, y + (i*2), x + 2, y + (i*2));<br />
}<br />
<br />
break;<br />
}<br />
<br />
if(this.borderStyle != System.Windows.Forms.Border3DStyle.Flat)<br />
{<br />
ControlPaint.DrawBorder3D(bg, this.ClientRectangle, this.borderStyle, Border3DSide.Left);<br />
ControlPaint.DrawBorder3D(bg, this.ClientRectangle, this.borderStyle, Border3DSide.Right);<br />
}<br />
}<br />
<br />
#endregion<br />
<br />
<br />
#region Horizontal Splitter<br />
<br />
else if (this.Dock == DockStyle.Top || this.Dock == DockStyle.Bottom)<br />
{<br />
rr = new Rectangle((int)r.X + ((r.Width - 115)/2), r.Y, 115, 8);<br />
this.Height = 8;<br />
<br />
if(hot)<br />
{<br />
bg.FillRectangle(new SolidBrush(hotColor), new Rectangle(rr.X, rr.Y + 1, 115, 6));<br />
}<br />
else<br />
{<br />
bg.FillRectangle(new SolidBrush(this.BackColor), new Rectangle(rr.X, rr.Y + 1, 115, 6));<br />
}<br />
<br />
bg.DrawLine(new Pen(SystemColors.ControlDark, 1), rr.X, rr.Y + 1, rr.X, rr.Y + rr.Height - 2);<br />
bg.DrawLine(new Pen(SystemColors.ControlDark, 1), rr.X + rr.Width, rr.Y + 1, rr.X + rr.Width, rr.Y + rr.Height - 2);<br />
<br />
if(this.Enabled)<br />
{<br />
bg.FillPolygon(new SolidBrush(SystemColors.ControlDarkDark), ArrowPointArray(rr.X + 3, rr.Y + 2));<br />
bg.FillPolygon(new SolidBrush(SystemColors.ControlDarkDark), ArrowPointArray(rr.X + rr.Width - 9, rr.Y + 2));<br />
}<br />
<br />
int x = rr.X + 14;<br />
int y = rr.Y + 3;<br />
<br />
switch(visualStyle)<br />
{<br />
case VisualStyles.Mozilla:<br />
<br />
for(int i=0; i < 30; i++)<br />
{<br />
bg.DrawLine(new Pen(SystemColors.ControlLightLight), x + (i*3), y, x + 1 + (i*3), y + 1);<br />
bg.DrawLine(new Pen(SystemColors.ControlDarkDark), x + 1 + (i*3), y + 1, x + 2 + (i*3), y + 2);<br />
if(hot)<br />
{<br />
bg.DrawLine(new Pen(hotColor), x + 1 + (i*3), y + 2, x + 2 + (i*3), y + 2);<br />
}<br />
else<br />
{<br />
bg.DrawLine(new Pen(this.BackColor), x + 1 + (i*3), y + 2, x + 2 + (i*3), y + 2);<br />
}<br />
}<br />
break;<br />
<br />
case VisualStyles.DoubleDots:<br />
<br />
for(int i=0; i < 30; i++)<br />
{<br />
bg.DrawRectangle(new Pen(SystemColors.ControlLightLight), x + 1 + (i*3), y, 1, 1 );<br />
bg.DrawRectangle(new Pen(SystemColors.ControlDark), x + (i*3), y - 1, 1, 1 );<br />
i++;<br />
bg.DrawRectangle(new Pen(SystemColors.ControlLightLight), x + 1 + (i*3), y + 2, 1, 1 );<br />
bg.DrawRectangle(new Pen(SystemColors.ControlDark), x + (i*3), y + 1, 1, 1 );<br />
}<br />
break;<br />
<br />
case VisualStyles.Win9x:<br />
<br />
bg.DrawLine(new Pen(SystemColors.ControlLightLight), x, y, x, y + 2);<br />
bg.DrawLine(new Pen(SystemColors.ControlLightLight), x, y, x + 88, y);<br />
bg.DrawLine(new Pen(SystemColors.ControlDark), x, y + 2, x + 88, y + 2);<br />
bg.DrawLine(new Pen(SystemColors.ControlDark), x + 88, y, x + 88, y + 2);<br />
break;<br />
<br />
case VisualStyles.XP:<br />
<br />
for(int i=0; i < 18; i++)<br />
{<br />
bg.DrawRectangle(new Pen(SystemColors.ControlLight), x + (i*5), y, 2, 2 );<br />
bg.DrawRectangle(new Pen(SystemColors.ControlLightLight), x + 1 + (i*5), y + 1, 1, 1 );<br />
bg.DrawRectangle(new Pen(SystemColors.ControlDarkDark), x +(i*5), y, 1, 1 );<br />
bg.DrawLine(new Pen(SystemColors.ControlDark), x + (i*5), y, x + (i*5) + 1, y);<br />
bg.DrawLine(new Pen(SystemColors.ControlDark), x + (i*5), y, x + (i*5), y + 1);<br />
}<br />
break;<br />
<br />
case VisualStyles.Lines:<br />
<br />
for(int i=0; i < 44; i++)<br />
{<br />
bg.DrawLine(new Pen(SystemColors.ControlDark), x + (i*2), y, x + (i*2), y + 2);<br />
}<br />
<br />
break;<br />
}<br />
<br />
if(this.borderStyle != System.Windows.Forms.Border3DStyle.Flat)<br />
{<br />
ControlPaint.DrawBorder3D(bg, this.ClientRectangle, this.borderStyle, Border3DSide.Top);<br />
ControlPaint.DrawBorder3D(bg, this.ClientRectangle, this.borderStyle, Border3DSide.Bottom);<br />
}<br />
}<br />
<br />
#endregion<br />
<br />
else<br />
{<br />
throw new Exception("The Collapsible Splitter control cannot have the Filled or None Dockstyle property");<br />
}<br />
<br />
<br />
g.DrawImage(b, 0, 0);<br />
<br />
bg.Dispose();<br />
b.Dispose();<br />
<br />
g.Dispose();<br />
}<br />
|