Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - How to Change CB Button visibility at runtime?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to Change CB Button visibility at runtime?

 Post Reply Post Reply
Author
Message
shipwreck View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 April 2008
Location: United States
Status: Offline
Points: 308
Post Options Post Options   Thanks (0) Thanks(0)   Quote shipwreck Quote  Post ReplyReply Direct Link To This Post Topic: How to Change CB Button visibility at runtime?
    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
Back to Top
Xander75 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 April 2007
Status: Offline
Points: 353
Post Options Post Options   Thanks (0) Thanks(0)   Quote Xander75 Quote  Post ReplyReply Direct Link To This Post 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)
Back to Top
Hemesh View Drop Down
Senior Member
Senior Member


Joined: 10 August 2010
Status: Offline
Points: 135
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hemesh Quote  Post ReplyReply Direct Link To This Post 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
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.125 seconds.