-
Disabling X in Message Boxes
I've got lots of info on disabling the close button in forms, but I want to make the grayed-out X (i.e., close button) completely invisible on a message box.
How do I do this? Here's the code I am using for the message box:
Private Sub Form_Unload(Cancel As Integer)
'When user clicks close, this confirmation
'box pops up; if user selects no, then
'Access returns user to the form
If MsgBox("Are you sure you want to exit?", _
vbYesNo, "Do you want to close?") = vbNo Then
Cancel = True
End If
End Sub
-
not sure it's that easy to do with the standard message boxes. You may have to look into API calls. Alternatively you can create a form that you can use as a message box.
-
Thanks for your thoughts!
-
Hi,
I have tried your code and the close button (X) from message box was not active !! You have not to write additional code, default status of close button on a message box (using your code) is disabled.
Gelu
-
Gelu, you are correct that it is disabled but it is grayed-out. I wanted it completely gone!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|