Results 1 to 7 of 7

Thread: SOLVED: (thanks) userform close-symbol

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2005
    Posts
    6

    SOLVED: (thanks) userform close-symbol

    Hello,
    is it possible to hide or to disable the close-symbol ((X) upper right) on a userform? And if so, how you do it ??
    Thanks in advange
    Last edited by tonyelyn; Oct 6th, 2005 at 11:08 AM.

  2. #2
    Junior Member
    Join Date
    Sep 2005
    Posts
    24

    Re: userform close-symbol

    Hi
    pls give some more information about the userfom!
    is it in VB / Excel / Word ...... ?

    Chris

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2005
    Posts
    6

    Re: userform close-symbol

    Quote Originally Posted by Chris67
    Hi
    pls give some more information about the userfom!
    is it in VB / Excel / Word ...... ?

    Chris
    excuse me,
    the form is made in EXCEL.
    Commandbuttons are on the userform and are used to simplify the work of other users.

  4. #4
    Superbly Moderated NeedSomeAnswers's Avatar
    Join Date
    Jun 2002
    Location
    Manchester uk
    Posts
    2,657

    Re: userform close-symbol

    I dont think you can get a handle on the Excel VBA userform object the same way you can in VB Form object to disable the X button.

    You can cheat though by intercepting the X QueryClose command like below

    put this code in a userform, and try pressing the X button !

    VB Code:
    1. Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
    2.  
    3. If CloseMode = vbFormControlMenu Then
    4. Cancel = True
    5. End If
    6.  
    7. End Sub

  5. #5
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: userform close-symbol

    I just wrote this code for you to actually Disable the 'x' close button on a VBA userform.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  6. #6
    Superbly Moderated NeedSomeAnswers's Avatar
    Join Date
    Jun 2002
    Location
    Manchester uk
    Posts
    2,657

    Re: userform close-symbol

    Fair play Rob Dogg,

    will be nicking that bit of code myself !!!

    Didn't know you could do that with VBA userforms.

  7. #7
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: userform close-symbol

    Me neither but I thought it was worth a try. Not having a controlbox or system menu I wouldnt think it would work but it did just as if it was there. The close menu item in the system menu is in the same place for all stardard windows. So I took a chance.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

Posting Permissions

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



Click Here to Expand Forum to Full Width