Print Page | Close Window

Setting control properties

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=1772
Printed Date: 16 November 2024 at 1:23pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Setting control properties
Posted By: Marek
Subject: Setting control properties
Date Posted: 09 February 2005 at 5:39pm

Hello,

Is there a way to disable or set the checked property on all instances of the same control, without using the Update event and without iterating through all controls in each command bar? Say I have the About control on the Help menu, and on the Standard command bar, and a user puts the same control on a new customized command bar. Is there a way to set a property on the 'parent' control so that the settings propogate to all instances without having to use the Update event?

We are considering updating our menu from the Infragistics toolbars which function like this.  Each button displayed on a menu or toolbar is an instance of a main ‘parent’ button.  Setting properties on this parent button propagates the property changes to all instances of the button.  This makes enabling/disabling all instances of a button a piece of cake.  Just use the buttons ID to do a find, this finds the parent button, any properties changed on this are reflected on the child controls.  Do the codejock controls have a similar technique, or how do I go about doing something similar?

Thanks,

-m




Replies:
Posted By: Oleg
Date Posted: 10 February 2005 at 1:25am
No, it doent't work with our controls. Update event is the way to update all control.

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


Posted By: gshawn
Date Posted: 10 February 2005 at 9:09am

To clarify Oleg's answer, the CodeJock controls still work in a somewhat similar way. Whether created via code or through the GUI Designer, each control is assigned a unique ID. In the CommandBars_Update event, you should do a "Select Case Control.ID." If there are multiple instances of the same control (for example, an About button that is both on a menu bar and in a toolbar) that share the same ID and one of them is disabled through the Update event, the other one will be disabled as well.

The following will enable/disable a save button both in the menu and standard toolbar.

Private Sub CommandBars_Update(ByVal Control As XtremeCommandBars.ICommandBarControl)
    Select Case Control.id
        Case ID_FILE_SAVE:      Control.Enabled = (FileHasChanged = True)
    End Select
End Sub




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