Print Page | Close Window

How to Change CB Button visibility at runtime?

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=17273
Printed Date: 06 October 2024 at 6:23am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to Change CB Button visibility at runtime?
Posted By: shipwreck
Subject: How to Change CB Button visibility at runtime?
Date Posted: 17 September 2010 at 11:09pm
Hello fellow developers! Unfortunately, I'm stuck again.

As you know, I've been working on a project, and I had the reload/stop button combined using actions. So here's my question:

Is there anyway I can put a "Go" button in with the three of those, and have it only appear when the text in the combo box I'm using is not the Web browser control's location URL and to have it switch back to reload when the text is the same as the location URL? I'm assuming this has something to do with the commandbars_update() function but I'm not entirely sure.


If there isn't a way to work that out, I'll settle with just being able to have the separate go button, and have it only appear and disappear under the same circumstances. Is there anyway I could possibly pull either of these off? If so, then how? Some code or a sample project would be absolutely great.

Thanks in advance everyone!


-------------
Product: Xtreme Suite Pro (Active-X), Version 15.3.1

Platform: Windows 7 Ultimate SP1 (64Bit) & Windows XP Mode SP3 (32Bit)

Language: Visual Basic 6.0 SP6



Replies:
Posted By: Xander75
Date Posted: 01 October 2010 at 5:06am
Hi,

I believe from reading your post you want to hide/show a button on a CommandBar Toolbar at runtime?

To do this, use the following code:


    Dim Control As XtremeCommandBars.CommandBarButton
    Set Control = CommandBars.FindControl(, ID_FILE_OPEN) ' Change ID_FILE_OPEN to be the ID of your button.
    Control.Visible = Not Control.Visible  ' Change "Not Control.Visible" to suit your needs


I have tested this in the Samples provided by CJ and it works fine.


-------------
Product: Xtreme SuitePro (ActiveX) v15.3.1
Platform: Windows 7 64-bit (SP1) Professional Edition
Languages: C#.Net using Visual Studio 2012 & Visual Basic 6.0 (SP6)


Posted By: Hemesh
Date Posted: 01 October 2010 at 6:25am
As an alternative to hiding/showing buttons, you could have this as a UserControl to behave in this way, then just add that to the CommandBar?


-------------
Product: Xtreme SuitePro (ActiveX) version 18.5.0

Platform: Windows 7 Enterprise (64-bit)

Language: Visual Basic 6.0



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