la proprietà ControlBox è a sola lettura in fase di esecuzione, per questo non puoi fare:
Me.ControlBox = False
prova così:
codice:
Private Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, ByVal bRevert As Long) As Long
Private Declare Function GetMenuItemCount Lib "user32" (ByVal hMenu As Long) As Long
Private Declare Function DrawMenuBar Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function RemoveMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
Const MF_BYPOSITION = &H400&
Const MF_REMOVE = &H1000&
Private Sub Command1_Click()
Dim hSysMenu As Long, nCnt As Long
hSysMenu = GetSystemMenu(Me.hwnd, False)
If hSysMenu Then
nCnt = GetMenuItemCount(hSysMenu)
If nCnt Then
RemoveMenu hSysMenu, nCnt - 1, MF_BYPOSITION Or MF_REMOVE
RemoveMenu hSysMenu, nCnt - 2, MF_BYPOSITION Or MF_REMOVE
DrawMenuBar Me.hwnd
End If
End If
End Sub
ricordati di aggiungere un pulsante per scaricare il form... ad esempio:
codice:
Command2_Click()
Unload Me
End Sub
Boolean