Remove Close button from Message Box (1 Viewer)

patkeaveney

Registered User.
Local time
Today, 09:40
Joined
Oct 12, 2005
Messages
75
Hi

Is it possible to remove the X (Close Button) from a messagebox.

I have searched the web, but to No avail
this is my code:

If Not Me.Dirty Then
MsgBox "No Additions or Changes made. Therefore SAVE not appropriate", vbInformation + vbOKOnly, "Add Status"​
End if


Thanks in Advance

Pat
 

DCrake

Remembered
Local time
Today, 09:40
Joined
Jun 8, 2005
Messages
8,626
The close button (x) is enabled / disabled depending on the type of msgbox buttons you have chosen. It appears that this is only available if you have a an Ok or a Cancel button defined.

With vbOK when clicked will return vbOK, with vbCancel it return vbCancel.

Any boxes that hve it enabled will always return vbCancel.

David
 

missinglinq

AWF VIP
Local time
Today, 04:40
Joined
Jun 20, 2003
Messages
6,420
The answer to your question is "No." You'd have to "roll your own" using a small form with the Border Style set to None and the Popup and Modal properties set to Yes..

The question is, "Why?"

Whether you hit OK or the Close X the box clears. Anything you want done after the box is closed will be done however you close the box.
 
Last edited:

patkeaveney

Registered User.
Local time
Today, 09:40
Joined
Oct 12, 2005
Messages
75
Very true missingling

I think I was trying to be too precise.

Thank your for your speedy reply

You too David


Pat
 

Users who are viewing this thread

Top Bottom