Results 1 to 5 of 5

Thread: Disabling X in Message Boxes

  1. #1
    Join Date
    Mar 2003
    Posts
    37

    Question 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

  2. #2
    Join Date
    Jan 2003
    Location
    UK
    Posts
    277
    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.

  3. #3
    Join Date
    Mar 2003
    Posts
    37
    Thanks for your thoughts!

  4. #4
    Join Date
    May 2003
    Location
    Romania
    Posts
    7
    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

  5. #5
    Join Date
    Mar 2003
    Posts
    37

    Cool

    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
  •