Kamis, 24 April 2014





Source code untuk membuat Form agar tidak bisa di Maximize.
Tombol Maximize pada Form di Disable sehingga Form tersebut tidak bisa di Maximize.
Buat 1 Project dengan :
1 Form
Copy source code berikut pada Form :

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

Semoga Bermanfaat
Categories:

0 komentar:

Posting Komentar