ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Userform close button (https://www.excelbanter.com/excel-programming/344655-userform-close-button.html)

Les Stout[_2_]

Userform close button
 
hi all, is it possible to hide thew close button on a form ? If so how
does one do it ?

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***

Harald Staff

Userform close button
 
Yes. See FormFun at
http://www.oaltd.co.uk/Excel/Default.htm

Best wishes dr Nosferatu

"Les Stout" skrev i melding
...
hi all, is it possible to hide thew close button on a form ? If so how
does one do it ?

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***




Jim Rech

Userform close button
 
If you want to prevent a user from closing the userform via the "x" just use
sub UserForm_QueryClose:
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode = 0 Then Cancel = True
End Sub

CloseMode is 0 when a userform is manually closed and 1 when closed through
code like this:


Private Sub CommandButton1_Click()
Unload UserForm1
End Sub



--
Jim
"Les Stout" wrote in message
...
| hi all, is it possible to hide thew close button on a form ? If so how
| does one do it ?
|
| Les Stout
|
| *** Sent via Developersdex http://www.developersdex.com ***




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

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