+ Reply to Thread
Results 1 to 4 of 4

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

  1. #1
    Registered User
    Join Date
    01-19-2006
    Posts
    35

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

    In VBA, is there any way of removing the little X buttons off the dialog boxes top right hand corner??

  2. #2
    Jim Cone
    Guest

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

    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


  3. #3

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

    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


  4. #4
    Valued Forum Contributor tony h's Avatar
    Join Date
    03-14-2005
    Location
    England: London and Lincolnshire
    Posts
    1,187
    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.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1