private void Center_MouseMove(object sender, MouseEventArgs e)
{
if (Action == SizeAction.SizeA && e.Button == MouseButtons.Left)
{
Point start;
int x = e.X - Center.Width/2;
int y = e.Y - Center.Height/2;
// ROB: Added fix for graphics splatter when sizing both splitters.
if (y + Horizontal.Top > Height - 4)
y = Height - 4 - Horizontal.Top;
if (y + Horizontal.Top < 0)
y = 0 - Horizontal.Top;
if (x + Vertical.Left > Width - 4)
x = Width - 4 - Vertical.Left;
if (x + Vertical.Left < 0)
x = 0 - Vertical.Left;
// END-ROB
if (!FirstTime)
{
start = PointToScreen(Location);
start.X += PrevPos.X + Vertical.Location.X;
ControlPaint.FillReversibleRectangle(new Rectangle(start.X, start.Y, 3, Height), Color.Black);
start = PointToScreen(Location);
start.Y += PrevPos.Y + Horizontal.Location.Y;
ControlPaint.FillReversibleRectangle(new Rectangle(start.X, start.Y, Width, 3),
SystemColors.ControlDark);
}
else
FirstTime = false;
start = PointToScreen(Location);
start.X += x + Vertical.Location.X;
ControlPaint.FillReversibleRectangle(new Rectangle(start.X, start.Y, 3, Height), Color.Black);
start = PointToScreen(Location);
start.Y += y + Horizontal.Location.Y;
ControlPaint.FillReversibleRectangle(new Rectangle(start.X, start.Y, Width, 3), SystemColors.ControlDark);
PrevPos = new Point(x, y);
}
}