Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / November 2006

Tip: Looking for answers? Try searching our database.

resizing a panel in a form with the mouse

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Julian - 02 Nov 2006 14:50 GMT
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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.