ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Remove Userform Deactivate Button (https://www.excelbanter.com/excel-programming/311566-remove-userform-deactivate-button.html)

Martin

Remove Userform Deactivate Button
 
I'm trying to remove the deactivate button from a Userform's button bar... is
this possible and how would I go about it?
Would be greatful for any help with this.

Thanks

Martin


Tom Ogilvy

Remove Userform Deactivate Button
 
Easier is to just manage closing of the form with the queryclose event:

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
'Prevent user from closing with the Close box in the title bar.
If CloseMode < 1 Then Cancel = 1
UserForm1.Caption = "Use the close button"
End Sub


If you still want to remove the X button, then you need to use the Windows
API.

See Stephen Bullen's site formfun.zip

http://www.bsmltd.ie

in the links on the left, go to the excel page

--
Regards,
Tom Ogilvy

"Martin" wrote in message
...
I'm trying to remove the deactivate button from a Userform's button bar...

is
this possible and how would I go about it?
Would be greatful for any help with this.

Thanks

Martin





All times are GMT +1. The time now is 07:23 PM.

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