|
-
Apr 4th, 2003, 04:38 PM
#1
Thread Starter
Lively Member
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
-
Apr 4th, 2003, 04:58 PM
#2
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() == 1) m.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.
-
Apr 5th, 2003, 12:00 PM
#3
Thread Starter
Lively Member
Works great
-
Apr 5th, 2003, 02:46 PM
#4
yay gay
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/
-
Apr 5th, 2003, 02:47 PM
#5
yay gay
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|