Does anyone know how to convert this VB6 api to VB.Net?
I always used it in vb6 to give my textboxes an flatter style.

VB Code:
  1. Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
  2. Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
  3. Declare Function SetWindowPos Lib "user32" (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal CX As Long, ByVal CY As Long, ByVal wFlags As Long) As Long
  4. Const GWL_EXSTYLE = (-20)
  5. Const WS_EX_CLIENTEDGE = &H200
  6. Const WS_EX_STATICEDGE = &H20000
  7. Const SWP_FRAMECHANGED = &H20
  8. Const SWP_NOMOVE = &H2
  9. Const SWP_NOOWNERZORDER = &H200
  10. Const SWP_NOSIZE = &H1
  11. Const SWP_NOZORDER = &H4
  12.  
  13. Sub MakeFlat(lHwnd As Long)
  14.     Dim lRet As Long
  15.     lRet = GetWindowLong(lHwnd, GWL_EXSTYLE)
  16.     lRet = WS_EX_STATICEDGE
  17.     SetWindowLong lHwnd, GWL_EXSTYLE, lRet
  18.     SetWindowPos lHwnd, 0, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE Or SWP_NOOWNERZORDER Or SWP_NOZORDER Or SWP_FRAMECHANGED
  19. End Sub