No problem just put this code in your form
then type DisableMenu to disable the cross and EnableMenu to enable it againCode:Private Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, ByVal bRevert As Long) As Long Private 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 Private Const MF_BYCOMMAND = &H0& Private Const MF_GRAYED = &H1& Private Const MF_ENABLED = &H0& Private Const SC_CLOSE = &HF060& Private Const FOOLVB = -10 Private Sub DisableMenu() ModifyMenu GetSystemMenu(Me.hwnd, 0), SC_CLOSE, MF_BYCOMMAND Or MF_GRAYED, FOOLVB, "Close" End Sub Private Sub EnableMenu() ModifyMenu GetSystemMenu(Me.hwnd, 0), SC_CLOSE, MF_BYCOMMAND Or MF_ENABLED, SC_CLOSE, "Close" End Sub
I don't know how much experience you have had with the API but make sure you put the Declare statements and constants at the top of the code otherwise it won't work
Hope this helps




Reply With Quote