ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Remove/Inactivate "X" in UserForm (https://www.excelbanter.com/excel-programming/405752-remove-inactivate-x-userform.html)

Otto Moehrbach

Remove/Inactivate "X" in UserForm
 
Excel XP & Win XP
An OP wants to remove (if possible) or inactivate the "X" button in the top
right corner of a UserForm. Is that possible, and if so, how?
Also, what code can I use to trap the action of clicking on that "X" and act
on that? Thanks for your time. Otto



Jim Rech[_2_]

Remove/Inactivate "X" in UserForm
 
Use the userform's QueryClose event:

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If MsgBox("Allow close?", vbYesNo) = vbNo Then Cancel = True
End Sub


--
Jim
"Otto Moehrbach" wrote in message
...
| Excel XP & Win XP
| An OP wants to remove (if possible) or inactivate the "X" button in the
top
| right corner of a UserForm. Is that possible, and if so, how?
| Also, what code can I use to trap the action of clicking on that "X" and
act
| on that? Thanks for your time. Otto
|
|




All times are GMT +1. The time now is 04:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com