I want to enable users to resize a panel at runtime by dragging a corner. Any ideas?
Thanks!
I want to enable users to resize a panel at runtime by dragging a corner. Any ideas?
Thanks!
I don't know about dragging corners, but you could dock the panel and use splitters to provide a place for users to resize the docked regions.
If you want to use an actual System.Windows.Forms.Panel and have it dynamically resize, then you will have to do it like if you were doing drag-n-drop. You will have to handle the mouse Click event on the panel, determine if you are on the edge of the panel (within a 2-3 pixels) and then handle the Drag events and change the Size property of the panel.
You could intercept the mouse location and the click.. if it's in a corner then set a resizing boolean and then on the mousemove event you could implement something like this..
if (_resizing)
{
this.Height = top + e.Y;
this.Width = width + e.X;
}