Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 104
Default disable the x button on a userform

Hi all,

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

manythanks

Johny5

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 292
Default disable the x button on a userform

Hi

Disable:

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

I think Hide is a part of FormFun. It's far more complex:
http://www.oaltd.co.uk/Excel/Default.htm

HTH. Best wishes Harald

skrev i melding
oups.com...
Hi all,

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

manythanks

Johny5



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 146
Default disable the x button on a userform

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/
_______

Harald Staff wrote:

Hi

Disable:

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

I think Hide is a part of FormFun. It's far more complex:
http://www.oaltd.co.uk/Excel/Default.htm

HTH. Best wishes Harald

skrev i melding
oups.com...

Hi all,

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

manythanks

Johny5





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default disable the x button on a userform

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

"Jon Peltier" skrev i melding
...
Rather than disable it, have it call the cancel button's code. That's what

users
expect it will do, right?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Disable Exit button on a UserForm Noemi Excel Discussion (Misc queries) 1 September 14th 06 09:37 PM
How to disable the Exit Button of UserForm in Excel? Alex Excel Programming 3 December 19th 04 11:55 PM
disable or hide the close window icon 'X' in the corner of a userform Tim[_39_] Excel Programming 4 September 24th 04 02:06 PM
Disable Button Pete JM[_3_] Excel Programming 2 April 12th 04 01:04 PM
Disable close button of Modeless Userform RB Smissaert Excel Programming 2 September 13th 03 09:46 PM


All times are GMT +1. The time now is 09:47 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"