Hi,
Found a "professional way" to drag a borderless form but the sample is written in VB.NET.

Can anyone change it to C# language please?
VB Code:
  1. //**************************************
  2.     //    
  3.     // Name: Most professional way of moving
  4.     //     a borderless form without APIs and witho
  5.     //     ut mouse pointer coordinates
  6.     // Description:Want to move a form by cl
  7.     //     ick and dragging on the client area beca
  8.     //     use your form is bordless/captionless? T
  9.     //     his IS the way to do it at low level pro
  10.     //     gramming without the use of APIs... full
  11.     //     y .NET-wise.
  12.     // By: Rodolfo Gonzalez Ruiz
  13.     //
  14.     // Assumes:Basically the code uses the W
  15.     //     ndProc and changes the window message to
  16.     //     make it believe that you are clicking on
  17.     //     the form/window title bar.
  18.     //
  19.     // Side Effects:User must click on the f
  20.     //     orm client area, if a control is placed
  21.     //     on top, clicking on it will not drag the
  22.     //     window.
  23.     //
  24.     //This code is copyrighted and has    // limited warranties.Please see http://
  25.     //     [url]www.Planet-Source-Code.com/vb/scripts/Sh[/url]
  26.     //     owCode.asp?txtCodeId=3965&lngWId=10    //for details.    //**************************************
  27.     //    
  28.    
  29.     'Place this code anywhere on your form code
  30.     #Region " ClientAreaMove Handling "
  31.     Const WM_NCHITTEST As Integer = &H84
  32.     Const HTCLIENT As Integer = &H1
  33.     Const HTCAPTION As Integer = &H2
  34.     Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
  35.     Select Case m.Msg
  36.     Case WM_NCHITTEST
  37.     MyBase.WndProc(m)
  38.     If m.Result = HTCLIENT Then m.Result = HTCAPTION
  39.     '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.
  40.     Case Else
  41.     'Make sure you pass unhandled messages back to the default message handler.
  42.     MyBase.WndProc(m)
  43.     End Select
  44.     End Sub
  45.     #End Region