Pregunta: Como bloquear el botton de cerrar de un formulario? Respuesta:
ok bueno aqui va la respuesta..
coloca esto en tu form
Código:
Private Sub Form_Load()
Bloquear_Cerrar
End Sub
Private Sub Bloquear_Cerrar()
Dim hMenu As Long
'
hMenu = GetSystemMenu(hWnd, 0)
' Deshabilitar el menú cerrar del formulario
Call ModifyMenu(hMenu, SC_CLOSE, MF_BYCOMMAND Or MF_GRAYED, -10, "Close")
End Sub
y en un modulo esto..
Código:
Public Declare Function GetSystemMenu Lib "user32" _
(ByVal hWnd As Long, ByVal bRevert As Long) As Long
Public Declare Function ModifyMenu Lib "user32" Alias "ModifyMenuA" _
(ByVal hMenu As Long, ByVal nPosition As Long, _
ByVal wFlags As Long, ByVal wIDNewItem As Long, _
ByVal lpString As Any) As Long
Public Declare Function DrawMenuBar Lib "user32" _
(ByVal hWnd As Long) As Long
'
Public Const MF_BYCOMMAND = &H0&
Public Const MF_ENABLED = &H0&
Public Const MF_GRAYED = &H1&
'
Public Const SC_CLOSE = &HF060&
nos vemos y espero les sirva el codigo...