disable the x button on a userform

  • Thread starter Thread starter john.9.williams
  • Start date Start date
J

john.9.williams

Hi all,

How can I disable the X (close button) on a userform, or hide it all
together

manythanks

Johny5
 
Rather than disable it, have it call the cancel button's code. That's what users
expect it will do, right?

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode = 0 Then
Cancel = True
btnCancel_Click
End If
End Sub

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______
 
If you want to get deep.. <g>
My experience is that when the X is clicked, it means "this is not what I
expected to see. i don't know or care what this is, but i'm sure it's
useless to me now. make it go away". Which may or may not be the same as
Cancel, depending on what Cancel does. Probably the same thing most of the
times, so you're right.

Best wishes Harald
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top