I have own control and I need to resize runtime by dragging. To resize bottom and right borders I use this:

```
protected override void OnMouseDown(MouseEventArgs e)
{
  SL = new System.Drawing.Point(Location.X + e.Location.X, Location.Y + e.Location.Y);
  SP = new System.Drawing.Point(Location.X, Location.Y);

  if (e.X <= m)
    _OnLeft = true;

  if (e.X >= Width - m)
    _OnRight = true;

  if (e.Y <= m)
    _OnTop = true;

  if (e.Y >= Height - m)
    _OnBottom = true;
}

protected override void OnMouseMove(MouseEventArgs e)
{
  // Change Width - right
  if (_OnRight && (!_OnTop && !_OnBottom))
  {
    if (e.X <= 1)
      return;
    Width = e.X;
    return;
  }

  // Change Height - bottom
  if (_OnBottom && (!_OnLeft && !_OnRight))
  {
    if (e.Y <= 1)
      return;
    Height = e.Y;
    return;
  }
}

```

All works fine. But I have problems with Top and Left resizing:

```
// Change Width - left
if (_OnLeft && (!_OnTop && !_OnBottom))
{
  // Problem part - I don't know condition to return
  if (Width + Left - e.X <= 1)
    return;
  Left += e.X - SL.X + SP.X;
  // How to get right width
  Width += Left - e.X;
  return;
}

// Change Height - top
if (_OnTop && (!_OnLeft && !_OnRight))
{
  // Problem part - I don't know condition to return
  if (Height + Top - e.Y <= 1)
    return;
  Top += e.Y - SL.Y + SP.Y;
  // How to get right height 
  Height += Top - e.Y;
  return;
}

```

Something like that. Have ideas?