|
-
Aug 5th, 2008, 03:00 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED][2008] Making my borderless form draggable.
Hi guys i need help on how to make my borderless form draggable or shall we say the user can easily drag the form anywhere. Need your help guys..God Bless and have a nice day!
Last edited by shyguyjeff; Aug 5th, 2008 at 04:16 AM.
-
Aug 5th, 2008, 03:34 AM
#2
Hyperactive Member
Re: [2008] Making my borderless form draggable.
Take a look at this, i think this is what you want?!
Mojo
-
Aug 5th, 2008, 03:44 AM
#3
Re: [2008] Making my borderless form draggable.
one question first before I try help you out - why does your signature say jmcilhinney but it links to someone else's profile (scootabug or someone) ?
Anyway, with that out of the way I needed to do this not long ago so when I get home I'll dig out the code I used. A quick google search found this though, however I'm sure thats not the way I did it before.
vb Code:
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
Select Case m.Msg
Case WM_NCHITTEST
MyBase.WndProc(m)
If m.Result = HTCLIENT Then m.Result = HTCAPTION
'If m.Result.ToInt32 = HTCLIENT Then m.Result = IntPtr.op_Explicit(HTCAPTION) 'Try this in VS.NET 2002/2003 if the latter line of code doesn't do it... thx to Suhas for the tip.
Case Else
'Make sure you pass unhandled messages back to the default message handler.
MyBase.WndProc(m)
End Select
End Sub
You place this code at class level in your form (meaning it does not go in any existing Sub or Function) and then the whole form area should be 'draggable'. See if it does what you want.
-
Aug 5th, 2008, 03:45 AM
#4
Re: [2008] Making my borderless form draggable.
 Originally Posted by mrmojorisin
Take a look at this, i think this is what you want?!
Mojo
Ahh yeah thats the way I did it before!
-
Aug 5th, 2008, 04:13 AM
#5
Thread Starter
Hyperactive Member
Re: [2008] Making my borderless form draggable.
Thanks guys..it's working...God Bless and have a nice day everyone..
-
Aug 5th, 2008, 04:22 AM
#6
Hyperactive Member
Re: [RESOLVED][2008] Making my borderless form draggable.
Glad to help and i think you should keep your link that way its funny!!
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
|