Código para desabilitar o botão fechar de um MDI Form em visual basic:
Em um módulo, coloca-se:
'Para desabilitar o botão Fechar
Public Declare Function DeleteMenu Lib "user32" (ByVal HMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
Public Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, ByVal bRevert As Long) As Long
Public Const MF_BYPOSITION = &H400&
No Load do Formulário coloca-se:
Dim HMenu as Long
'Desabilita Botão Fechar
HMenu = GetSystemMenu(hwnd, False)
DeleteMenu HMenu, 6, MF_BYPOSITION
Em um módulo, coloca-se:
'Para desabilitar o botão Fechar
Public Declare Function DeleteMenu Lib "user32" (ByVal HMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
Public Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, ByVal bRevert As Long) As Long
Public Const MF_BYPOSITION = &H400&
No Load do Formulário coloca-se:
Dim HMenu as Long
'Desabilita Botão Fechar
HMenu = GetSystemMenu(hwnd, False)
DeleteMenu HMenu, 6, MF_BYPOSITION
Mui bom , Mui boom, muchas gracitas bambino
ResponderExcluir