View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JW[_2_] JW[_2_] is offline
external usenet poster
 
Posts: 638
Default Removing a control

On Oct 8, 6:45 pm, Mekinnik
wrote:
How do I remove the close control from the upper right corner of my user form?


While it is possible to remove the control completely via API calls
and such, it is much easier to just capture the event when the user
clicks on the close button and handle it.
Private Sub UserForm_QueryClose _
(Cancel As Integer, CloseMode As Integer)
If CloseMode = vbFormControlMenu Then
MsgBox "Hey, don't do that!!!!"
Cancel = True
End If
End Sub