Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private 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
Private Const SWP_FRAMECHANGED = &H20
Private Const SWP_NOSIZE = &H1
Private Const SWP_NOZORDER = &H4
Private Const SWP_NOMOVE = &H2
Private Const SWP_DRAWFRAME = SWP_FRAMECHANGED
Private Const GWL_EXSTYLE = (-20)
Private Const GWL_STYLE = (-16)
Private Const WS_THICKFRAME = &H40000
Sub Resizecontrol(ctlName As Form, frmName As Form)
Dim NewStyle As Long
NewStyle = GetWindowLong(ctlName.hwnd, GWL_STYLE)
NewStyle = NewStyle Or WS_THICKFRAME
NewStyle = SetWindowLong(ctlName.hwnd, GWL_STYLE, NewStyle)
SetWindowPos ctlName.hwnd, frmName.hwnd, 0, 0, 0, 0, SWP_NOZORDER Or SWP_NOSIZE Or SWP_NOMOVE Or SWP_DRAWFRAME
End Sub
Private Sub Form_Load()
Resizecontrol Form1, Form1
End Sub