Form - Rendere Non Attiva Il Bottone X Di Un Form




Form # ' USO delle API (Sostituire a "Me" la form interessata)
'Disattivare il tastino X di chiusura di una finestra

'(il tasto ALT-F4 continua ad essere operante)

Const MF_REMOVE = &H1000&
Const SC_CLOSE = &HF060
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
Call RemoveMenu(GetSystemMenu(Me.hwnd, 0), SC_CLOSE, MF_REMOVE)










( formrenderenonattivailbottonexdiunform.html )- by Paolo Puglisi - Modifica del 17/12/2023