Hi,
I am following up on an older thread about resizing a panel in a form
with the mouse.
http://groups.google.de/group/microsoft.public.dotnet.framework.windowsforms/bro
wse_thread/thread/25b6d27b21064907/bb247a9b14219d94?lnk=st&q=pop+up+user+control
+resizable&rnum=1&hl=de#bb247a9b14219d94
I tried this code to manipulate the right border of the panel but I
have a problem:
public class SizablePanel : Panel
{
private const int WM_NCHITTEST = 0x0084;
private const int HTRIGHT = 11;
protected override void WndProc(ref Message m)
{
base.WndProc(ref m);
if (m.Msg == WM_NCHITTEST)
{
Point pos = new Point((int)m.LParam);
pos = this.PointToClient(pos);
if (pos.X > this.Width - 5)
m.Result = new IntPtr(HTRIGHT);
}
}
}
I cannot make the panel narrower than about 120 pixel.
Does anyone have a solution to that?
Also I would like to drag the panel horizontally.
Stoitcho Goutsev (100) - 06 Nov 2006 16:29 GMT
Julian,
I copy/paste your exact code in a test application and I have no problem
resizing the panel. Are you sure that there is not some constraints on the
size of the panel that you may enforce. Check the MinimumSize property of
the panel. The code that I have posted does not apply any size limitations.

Signature
Stoitcho Goutsev (100)
> Hi,
>
[quoted text clipped - 28 lines]
>
> Also I would like to drag the panel horizontally.