Print Page | Close Window

Control.Enabled always returns True in Execute Sub

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=8377
Printed Date: 18 June 2025 at 9:36am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Control.Enabled always returns True in Execute Sub
Posted By: MikeArmstrong
Subject: Control.Enabled always returns True in Execute Sub
Date Posted: 10 October 2007 at 6:20am
Hi,

I have used KeyBindings to create keyboard shortcuts to my menu functions.

However, when I use the keyboard shortcut, the 'Enabled' status of the control is ignored.  I therefore put a check at the top of the CommandBars_Execute procedure to the effect of

If Not Control.Enabled Then
    Exit Sub
End If

However, Control.Enabled always returns True, even when I can see the button on the CommandBar is NOT enabled.

Control.ID does return the correct ID however the ToolTipText and Description properties are empty.  The control does display a tooltip though.

Something doesn't add up here...

Any Ideas?

Thanks

Mike



Replies:
Posted By: Oleg
Date Posted: 10 October 2007 at 2:10pm
Hello,
its designed behavior. You create kebinding for Id - not for some button instance.
 
I recommend you enable/disable controls in update handlers or using Actions - this way keybinging will be also disabled.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



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