Changing .Enabled in design time |
Post Reply |
Author | |
Mess
Newbie Joined: 27 April 2009 Status: Offline Points: 7 |
Post Options
Thanks(0)
Posted: 27 April 2009 at 2:14pm |
Hi,
I'm trying to set the visibility and to enable and disable controls at run-time. I'm using Actions as described and have also read the sample code, but I don't seem to get it to work.
I created the action before everything else is created, and add this simple code when clicking a button:
Dim Action As CommandBarAction
Set Action = CommandBars.Actions(ID_HTML_EDIT) When I change the Action.Enabled the properties changes as they should, but the button doesn't gray out of disappear as I want visually. What seems to be the problem here?
Thank you,
Bjarne
|
|
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1354 |
Post Options
Thanks(0)
|
Here's some code that I just test that works. You need a form with a CommandBars control (CommandBars1) and a standard VB6 CommandButton control (Command1):
The key for me was to define the Action before adding the controls. |
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|
Mess
Newbie Joined: 27 April 2009 Status: Offline Points: 7 |
Post Options
Thanks(0)
|
Thank you. I got this to work by setting the status bar to Nothing and then instantiating a new StatusBar after that.
Thanks.
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |