Private Declare Function GetSystemMenu Lib "USER32" _
(ByVal hWnd As Long, _
ByVal bRevert As Long) As Long
'---------------------
Private Declare Function RemoveMenu Lib "USER32" _
(ByVal hme2nu As Long, _
ByVal nPosition As Long, _
ByVal wFlags As Long) As Long
'-----------------------------------------------------
Private Declare Function FindWindowA Lib "USER32" _
(ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long
'-----------------------------------------------------
Private Const MF_BYPOSITION As Long = &H400&
'---------------------------------------
Public Sub FormatUserForm(UserFormCaption As String)
Dim lFrmHdl As Long
lFrmHdl = FindWindowA("ThunderDFrame", UserFormCaption)
If lFrmHdl <> 0 Then
RemoveMenu GetSystemMenu(lFrmHdl, False), 1, MF_BYPOSITION
End If
End Sub
'--------------------------------------------------------------------
Sub ShowForm()
UserForm1.Show
End Sub