Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - Setting control properties
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Setting control properties

 Post Reply Post Reply
Author
Message
Marek View Drop Down
Groupie
Groupie


Joined: 02 February 2005
Status: Offline
Points: 20
Post Options Post Options   Thanks (0) Thanks(0)   Quote Marek Quote  Post ReplyReply Direct Link To This Post Topic: Setting control properties
    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

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
gshawn View Drop Down
Senior Member
Senior Member


Joined: 04 October 2004
Status: Offline
Points: 227
Post Options Post Options   Thanks (0) Thanks(0)   Quote gshawn Quote  Post ReplyReply Direct Link To This Post 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

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.172 seconds.