10-27-2009, 07:21 AM
(10-27-2009, 03:10 AM)malcomhfc Wrote: One problem your going to run into when using a borderless form is, the ability to drag the form around the screen. Using the snippet code below this will fix it.
Paste this anywhere in your Form code. Enjoy
Code:Const WM_NCHITTEST As Integer = &H84
Const HTCLIENT As Integer = &H1
Const HTCAPTION As Integer = &H2
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
Case Else
'Make sure you pass unhandled messages back to the default message handler.
MyBase.WndProc(m)
End Select
End Sub
Thanks for this.