Senin, 11 Agustus 2008

Matikan Tombol Close Pada Form

- Pada Module

Private Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, ByVal bRevert As Long) As Long
Private Declare Function RemoveMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
Private Const MF_BYPOSITION = &H400&

Public Sub RemoveCancelMenuItem(frm As Form)
Dim hSysMenu As Long
hSysMenu = GetSystemMenu(frm.hwnd, 0)
Call RemoveMenu(hSysMenu, 6, MF_BYPOSITION)
Call RemoveMenu(hSysMenu, 5, MF_BYPOSITION)
End Sub
----------------------------------------------------------------------------------------------
- Pada Form

Private Sub Form_Load()
RemoveCancelMenuItem Me
End Sub

Tidak ada komentar: