Puede utilizar Utilice este "hecho en casa" clase. Para un correcto funcionamiento, debe tener un contenedor y un elemento de ajuste dentro, como una imagen delgada que funcione como un borde de cambio de tamaño. El controlToResize es el contenedor en sí. Puedes poner todo lo que quieras dentro del control. Ejemplo:
ControlResizer.Init(myPictureBox, myTableLayoutPanel, ControlResizer.Direction.Vertical, Cursors.SizeNS);
Aquí está la clase.
class ControlResizer
{
public enum Direction
{
Horizontal,
Vertical
}
public static void Init(Control resizer, Control controlToResize, Direction direction, Cursor cursor)
{
bool dragging = false;
Point dragStart = Point.Empty;
int maxBound;
int minBound;
resizer.MouseHover += delegate(object sender, EventArgs e)
{
resizer.Cursor = cursor;
};
resizer.MouseDown += delegate(object sender, MouseEventArgs e)
{
dragging = true;
dragStart = new Point(e.X, e.Y);
resizer.Capture = true;
};
resizer.MouseUp += delegate(object sender, MouseEventArgs e)
{
dragging = false;
resizer.Capture = false;
};
resizer.MouseMove += delegate(object sender, MouseEventArgs e)
{
if (dragging)
{
if (direction == Direction.Vertical)
{
minBound = resizer.Height;
maxBound = controlToResize.Parent.Height - controlToResize.Top - 20;
controlToResize.Height = Math.Min(maxBound , Math.Max(minBound, controlToResize.Height + (e.Y - dragStart.Y)));
}
if (direction == Direction.Horizontal)
{
minBound = resizer.Width;
maxBound = controlToResize.Parent.Width - controlToResize.Left - 20;
controlToResize.Width = Math.Min(maxBound, Math.Max(minBound, controlToResize.Width + (e.X - dragStart.X)));
}
}
};
}
}
Por favor, vea este post mío. Tal vez puede ayudarle .. http://stackoverflow.com/questions/17264225/how-can-user-resize-control-at-runtime-in-winforms – Kix46
Pruebe este enlace: http: // stackoverflow .com/questions/17264225/how-can-user-resize-control-at-runtime-in-winforms – Kix46