Results 1 to 5 of 5

Thread: Moving Window

  1. #1

    Thread Starter
    Lively Member Cagez's Avatar
    Join Date
    Oct 2002
    Posts
    121

    Moving Window

    I want to hide the normal title bar, but I also want the user to be able to drag the window around.

    I was thinking of putting a transparent panel and putting it on the "drag spot", putting a mouse down event to it, but then I just need to know how to get where the mouse is and to relocate the windows etc.

    Any help would be great Thanks in advance

  2. #2
    PowerPoster sunburnt's Avatar
    Join Date
    Feb 2001
    Location
    Boulder, Colorado
    Posts
    1,403
    I was doing this just the other day and ran across this code snippet. This will allow the user to drag the form by clicking and holding any blank part of the form. This may not be exactly what you want, but it's an alternative.

    PHP Code:
    protected override void WndProc(ref System.Windows.Forms.Message m)
    {
        
    base.WndProc(ref m);
        if (
    m.Msg == 0x84)
            if (
    m.Result.ToInt32() == 1m.Result = new IntPtr(2);

    I'm not sure exactly what it's doing, since whoever wrote this didn't use the WM_ constants, but it works for me
    Every passing hour brings the Solar System forty-three thousand miles closer to Globular Cluster M13 in Hercules -- and still there are some misfits who insist that there is no such thing as progress.

  3. #3

    Thread Starter
    Lively Member Cagez's Avatar
    Join Date
    Oct 2002
    Posts
    121
    Works great

  4. #4
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    why when i just do :
    Code:
    protected override void WndProc(ref System.Windows.Forms.Message m) {
    }
    i get an error which says it couldnt create a handle? i am missing something?
    \m/\m/

  5. #5
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    ah found! had to do : base.WndProc(ref m);
    \m/\m/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width