Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - [SOLVED] Disable all buttons
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[SOLVED] Disable all buttons

 Post Reply Post Reply
Author
Message
gibra View Drop Down
Senior Member
Senior Member


Joined: 31 October 2008
Location: Italy
Status: Offline
Points: 288
Post Options Post Options   Thanks (0) Thanks(0)   Quote gibra Quote  Post ReplyReply Direct Link To This Post Topic: [SOLVED] Disable all buttons
    Posted: 14 April 2011 at 5:48pm
I have a toolbar where I could disable all buttons at once.
 
I don't find a property like Enabled which allows me this action.
The better should be something like Toolbar.Enabled = True/False
i.e.
 
CODE
 
With CommandBarContacts
    .DeleteAll
    .EnableCustomization False
    .Options.ShowExpandButtonAlways = False
    .Icons.LoadBitmap gsIcons16x16, gaArray16x16, XtremeCommandBars.XTPImageState.xtpImageNormal

    Set cToolbar = .Add("Contacts", xtpBarTop)   
    With cToolbar
        .SetIconSize 16, 16
        .ShowGripper = False
        .Customizable = False
        .EnableDocking xtpFlagStretchedShared
        .Enabled = False
        ' Or .EnableAllButtons = False
    End With
End With
 
How to? Cry
 
The only way to disable all buttons that I find is:
Public Sub DisableToolbar(ByRef tb As CommandBar, ByVal bMode As Boolean)
    Dim btn As CommandBarControl
    For Each btn In tb.Controls
        btn.enabled = bMode
    Next
End Sub
 
 
gibra
CJ SuiteControl v: 13.x to 19.x
Windows 10 64bit
VS2019 - VB6.0 SP6
<a href="http://nuke.vbcorner.net/Home/tabid/36/language/en-US/Default.aspx" rel="nofollow">VS/VB 6.0 Installer v6.8
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 15 April 2011 at 8:07am
Hi,

Use Update handler:

  if Control.Parent.BarID = ID_MY_BAR then Control.Enabled = False


Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
gibra View Drop Down
Senior Member
Senior Member


Joined: 31 October 2008
Location: Italy
Status: Offline
Points: 288
Post Options Post Options   Thanks (0) Thanks(0)   Quote gibra Quote  Post ReplyReply Direct Link To This Post Posted: 15 April 2011 at 12:43pm

Thank, Smile

I will try your suggestion.
gibra
CJ SuiteControl v: 13.x to 19.x
Windows 10 64bit
VS2019 - VB6.0 SP6
<a href="http://nuke.vbcorner.net/Home/tabid/36/language/en-US/Default.aspx" rel="nofollow">VS/VB 6.0 Installer v6.8
Back to Top
gibra View Drop Down
Senior Member
Senior Member


Joined: 31 October 2008
Location: Italy
Status: Offline
Points: 288
Post Options Post Options   Thanks (0) Thanks(0)   Quote gibra Quote  Post ReplyReply Direct Link To This Post Posted: 16 April 2011 at 4:20am
thank, Oleg.
 
CommandBars Update event is the best choice to set/get disable state.
gibra
CJ SuiteControl v: 13.x to 19.x
Windows 10 64bit
VS2019 - VB6.0 SP6
<a href="http://nuke.vbcorner.net/Home/tabid/36/language/en-US/Default.aspx" rel="nofollow">VS/VB 6.0 Installer v6.8
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.203 seconds.