Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / January 2006

Tip: Looking for answers? Try searching our database.

Taking out the 'Close Button' in the top right hand corner of dialog boxes

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
pspyve - 20 Jan 2006 02:19 GMT
In VBA, is there any way of removing the little X buttons off the dialog
boxes top right hand corner??

Signature

pspyve

Jim Cone - 20 Jan 2006 04:47 GMT
p,

Do you mean dialog box or do you mean userform?
If a userform then look at the QueryClose event for the form.
You can use that to prevent the form from closing.

Jim Cone
San Francisco, USA

"pspyve"
wrote in message
In VBA, is there any way of removing the little X buttons off the dialog
boxes top right hand corner??
pspyve
paul.robinson@it-tallaght.ie - 20 Jan 2006 09:26 GMT
Hi
This won't remove it, but it will disable it

'Sub suggested in Green, page190
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As
Integer)
Application.EnableEvents = False
   If CloseMode = vbFormControlMenu Then
       MsgBox "Please use only the Cancel button", vbCritical, "This
cancel is disabled"
       Cancel = True
   End If
Application.EnableEvents = True
End Sub

regards
Paul
tony h - 20 Jan 2006 09:57 GMT
I know there was an API that removed it - using 97 - and probably would
work for later versions but not something I would recommend unlessyou
know what you are doing. and really need to do this

I am away from home and haven't got the code on me.

Signature

tony h

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.