Print Page | Close Window

[SOLVED] Disable all buttons

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=18225
Printed Date: 06 May 2024 at 9:27pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: [SOLVED] Disable all buttons
Posted By: gibra
Subject: [SOLVED] Disable all buttons
Date 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



Replies:
Posted By: Oleg
Date 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


Posted By: gibra
Date 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


Posted By: gibra
Date 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



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net