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!
Printable View
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!
Take a look at this, i think this is what you want?!
Mojo
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.
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.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
Ahh yeah thats the way I did it before!Quote:
Originally Posted by mrmojorisin
Thanks guys..it's working...God Bless and have a nice day everyone..:wave:
Glad to help and i think you should keep your link that way its funny!!