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:
Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long 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 Const GWL_EXSTYLE = (-20) Const WS_EX_CLIENTEDGE = &H200 Const WS_EX_STATICEDGE = &H20000 Const SWP_FRAMECHANGED = &H20 Const SWP_NOMOVE = &H2 Const SWP_NOOWNERZORDER = &H200 Const SWP_NOSIZE = &H1 Const SWP_NOZORDER = &H4 Sub MakeFlat(lHwnd As Long) Dim lRet As Long lRet = GetWindowLong(lHwnd, GWL_EXSTYLE) lRet = WS_EX_STATICEDGE SetWindowLong lHwnd, GWL_EXSTYLE, lRet SetWindowPos lHwnd, 0, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE Or SWP_NOOWNERZORDER Or SWP_NOZORDER Or SWP_FRAMECHANGED End Sub




Reply With Quote