hello Visual Basic master, I want to ask about how to turn off resizing on form.exe in visual basic?
[ASK] How to disable Resize form.exe on VB 6 Portable?
Private Const GWL_STYLE = (-16)
Private Const WS_MAXIMIZEBOX = &H10000
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 GetWindowLong Lib "user32" Alias "GetWindowLongA" _
(ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Sub Form_Load()
Dim lStyle As Long
'disable MAXIMIZE button
lStyle = GetWindowLong(Me.hwnd, GWL_STYLE)
lStyle = lStyle And Not WS_MAXIMIZEBOX
Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle)
End Sub
Permissions in this forum:
You cannot reply to topics in this forum