Hi,
i have a problem with the BackColor Property. First a little bit about my problem.
I want to write a program which should display several Toolbars with different elements. I am using a StyleLibary to get the same design in all programs. Now I want to change the backcolor just for some of the elements on the toolbar. For the settings that a are not in stylelibary everything works fine, but if the property i want to change is in the stylelibary nothing happened if i change the value in the program.
How can i realize it, to overwrite the setting of the stylelibary?
Thanks for Help
P.S. Sorry for my bad english i am little bit out of training, hope you understand what i want to say.
Typically, the AppStylist setting overrides any settings in the application. There is really not way around this. This is the way it has to work in order for AppStylist to be useful.
You can change this behavior in the Application Style Library by setting the ResolutionOrder property on a Component Role. But this means that all settings in the applications will take precedence over the AppStylist setting. It's all or nothing, you cannot control this for an individual property or setting.
Appearance settings for individual objects will override AppStylist settings, though. For example, if you apply a BackColor to a single Button on a toolbar, it makes sense that that BackColor would be honored since AppStylist styles the application at a more general level.
You might be able to acheive what you want using StyleSets. Your Application Style Library could contain a base StyleSet that applies to all toolbars and then derived StyleSets which pick up the base properties, but have different, more specific, settings for some UIRoles. Then you could specify a StyleSetName on each of the UltraToolbarsManagers in your application so that each one is different.
Mike Saltzman"] Hi, ... You might be able to acheive what you want using StyleSets. Your Application Style Library could contain a base StyleSet that applies to all toolbars and then derived StyleSets which pick up the base properties, but have different, more specific, settings for some UIRoles. Then you could specify a StyleSetName on each of the UltraToolbarsManagers in your application so that each one is different.
... You might be able to acheive what you want using StyleSets. Your Application Style Library could contain a base StyleSet that applies to all toolbars and then derived StyleSets which pick up the base properties, but have different, more specific, settings for some UIRoles. Then you could specify a StyleSetName on each of the UltraToolbarsManagers in your application so that each one is different.
Thanks for the answer, can you give a example for such a procedure. I am new to infragistics and work with it for less than a week.
Can i make a styleset and give it directly to a ButtonTool in the Toolbar? I did not find such a function. Only the Toolbarmanager can get a style assigned.
best regards Martin
Just for future reference... you can't assign a StyleSet to an individual button or tool - only to the whole component.
But an Appearance on an individual tool in code will override the AppStylist settings, anyway.
If you want the appearance of a single tool (or any object, really), then there's a property on the Appearance object call StyleLibraryResourceName. This tells the Appearance to pick up it's settings from a Resource within the Style Library.
i tested a little bit with the stylesets
Dim nameOfStyleSet As String = "test"Dim library As New ApplicationStyleLibrary() library.LoadFromStyleManager() Dim newStyleSet As StyleSetSettings = NothingIf element.Formatierung IsNot Nothing Then newStyleSet = library.StyleSets.Add(nameOfStyleSet) newStyleSet.BasedOn = library.DefaultStyleSet Dim roleName As String = "ToolbarItemLabel" Dim appearance As AppearanceBase = newStyleSet.RoleStyles.GetStyle(roleName, True).States.GetState(RoleState.Normal, True).Appearance newStyleSet.ComponentStyles.Add(roleName) With appearance .BackColor = ElementFormatierung.Farbwert(ElementFormatierung.Farbe.gruen) .BackColorDisabled = Color.Transparent .ForeColor = ElementFormatierung.Farbwert(element.Formatierung.TextFarbe) .FontData.SizeInPoints = 30 'element.Formatierung.TextGroesse End With toolBarManager.Toolbars(0).Tools(element.Id).ComponentRole.StyleSetName = newStyleSet.Key library.UpdateStyleManager() End If
my problem is now that the assigned styleset is used bei every ToolBarItemLabel ...
how can i assign a different styleset for every control?
--> this way seems not right
toolBarManager.Toolbars(0).Tools(element.Id).ComponentRole.StyleSetName = newStyleSet.Key
EDIT: Got a Solution ty for Help