App style using infragistics on forms

Mkontwg

Member
Hi Team

I am applying theme and styles using Styling from my form. I have managed to use one per each toolbar. My question is how to I set the style throughout each toolbar?
Code:
        /* ultraToolbarsManager1 */
        /*  */
        THIS-OBJECT:ultraToolbarsManager1:Cursor = System.Windows.Forms.Cursors:SizeAll.
        THIS-OBJECT:ultraToolbarsManager1:DesignerFlags = 1.
        THIS-OBJECT:ultraToolbarsManager1:DockWithinContainer = THIS-OBJECT.
        THIS-OBJECT:ultraToolbarsManager1:DockWithinContainerBaseType = Progress.Util.TypeHelper:GetType("Progress.Windows.Form").
        THIS-OBJECT:ultraToolbarsManager1:FormDisplayStyle = Infragistics.Win.UltraWinToolbars.FormDisplayStyle:StandardWithRibbon.
        ribbonTab1:Caption = "Preferences".
        ribbonGroup1:Caption = "Styles".
        @VisualDesigner.FormMember (NeedsInitialize="false", InitializeArray="true").
        DEFINE VARIABLE arrayvar3 AS Infragistics.Win.UltraWinToolbars.ToolBase EXTENT 14 NO-UNDO.
        arrayvar3[1] = labelTool3.
        arrayvar3[2] = labelTool1.
        arrayvar3[3] = buttonTool5.
        arrayvar3[4] = labelTool5.
        arrayvar3[5] = labelTool7.
        arrayvar3[6] = labelTool9.
        arrayvar3[7] = labelTool21.
        arrayvar3[8] = labelTool13.
        arrayvar3[9] = buttonTool7.
        arrayvar3[10] = labelTool19.
        arrayvar3[11] = labelTool17.
        arrayvar3[12] = labelTool15.
        arrayvar3[13] = labelTool23.
        arrayvar3[14] = labelTool25.
        ribbonGroup1:Tools:AddRange(arrayvar3).
        @VisualDesigner.FormMember (NeedsInitialize="false", InitializeArray="true").
        DEFINE VARIABLE arrayvar4 AS Infragistics.Win.UltraWinToolbars.RibbonGroup EXTENT 1 NO-UNDO.
        arrayvar4[1] = ribbonGroup1.
        ribbonTab1:Groups:AddRange(arrayvar4).
        @VisualDesigner.FormMember (NeedsInitialize="false", InitializeArray="true").
        DEFINE VARIABLE arrayvar5 AS Infragistics.Win.UltraWinToolbars.RibbonTab EXTENT 1 NO-UNDO.
        arrayvar5[1] = ribbonTab1.
        THIS-OBJECT:ultraToolbarsManager1:Ribbon:NonInheritedRibbonTabs:AddRange(arrayvar5).
        THIS-OBJECT:ultraToolbarsManager1:Ribbon:Visible = TRUE.
        THIS-OBJECT:ultraToolbarsManager1:StyleSetName = "vStyles".
        appearance1:Image = CAST(resources:GetObject("appearance1.Image"), System.Object).
        buttonTool6:SharedPropsInternal:AppearancesSmall:Appearance = appearance1.
        buttonTool6:SharedPropsInternal:Caption = "Rubber Black".
        buttonTool6:Tag = "Rubber Black.isl".
        appearance2:Image = CAST(resources:GetObject("appearance2.Image"), System.Object).
        buttonTool8:SharedPropsInternal:AppearancesSmall:Appearance = appearance2.
        buttonTool8:SharedPropsInternal:Caption = "Red Planet".
        buttonTool8:SharedPropsInternal:DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle:ImageAndText.
        buttonTool8:Tag = "Red Planet. isl".
        appearance3:Image = CAST(resources:GetObject("appearance3.Image"), System.Object).
        labelTool2:SharedPropsInternal:AppearancesSmall:Appearance = appearance3.
        labelTool2:SharedPropsInternal:Caption = "Trendy".
        labelTool2:Tag = "Trendy.isl".
        appearance4:Image = CAST(resources:GetObject("appearance4.Image"), System.Object).
        labelTool4:SharedPropsInternal:AppearancesSmall:Appearance = appearance4.
        labelTool4:SharedPropsInternal:Caption = "Windows 7".
        labelTool4:Tag = "Windows7.isl".
        appearance5:Image = CAST(resources:GetObject("appearance5.Image"), System.Object).
        labelTool6:SharedPropsInternal:AppearancesSmall:Appearance = appearance5.
        labelTool6:SharedPropsInternal:Caption = "Pear".
        labelTool6:Tag = "Pear.isl".
        appearance6:Image = CAST(resources:GetObject("appearance6.Image"), System.Object).
        labelTool8:SharedPropsInternal:AppearancesSmall:Appearance = appearance6.
        labelTool8:SharedPropsInternal:Caption = "Noir Modeme".
        labelTool8:Tag = "Noir Modeme.isl".
        appearance7:Image = CAST(resources:GetObject("appearance7.Image"), System.Object).
        labelTool10:SharedPropsInternal:AppearancesSmall:Appearance = appearance7.
        labelTool10:SharedPropsInternal:Caption = "Nautilius".
        labelTool10:Tag = "Nautilius.isl".
        appearance8:Image = CAST(resources:GetObject("appearance8.Image"), System.Object).
        labelTool14:SharedPropsInternal:AppearancesSmall:Appearance = appearance8.
        labelTool14:SharedPropsInternal:Caption = "Metro".
        labelTool14:Tag = "Metro.isl".
        appearance9:Image = CAST(resources:GetObject("appearance9.Image"), System.Object).
        buttonTool31:SharedPropsInternal:AppearancesSmall:Appearance = appearance9.
        buttonTool31:SharedPropsInternal:Caption = "Lucid Dream".
        buttonTool31:Tag = "Lucid Dream.isl".
        appearance10:Image = CAST(resources:GetObject("appearance10.Image"), System.Object).
        labelTool16:SharedPropsInternal:AppearancesSmall:Appearance = appearance10.
        labelTool16:SharedPropsInternal:Caption = "Claymation".
        labelTool16:Tag = "Claymation.isl".
        appearance11:Image = CAST(resources:GetObject("appearance11.Image"), System.Object).
        labelTool18:SharedPropsInternal:AppearancesSmall:Appearance = appearance11.
        labelTool18:SharedPropsInternal:Caption = "Grape Tomato".
        labelTool18:Tag = "Grape Tomato.isl".
        appearance12:Image = CAST(resources:GetObject("appearance12.Image"), System.Object).
        labelTool20:SharedPropsInternal:AppearancesSmall:Appearance = appearance12.
        labelTool20:SharedPropsInternal:Caption = "IG".
        labelTool20:Tag = "IG.isl".
        appearance13:Image = CAST(resources:GetObject("appearance13.Image"), System.Object).
        labelTool22:SharedPropsInternal:AppearancesSmall:Appearance = appearance13.
        labelTool22:SharedPropsInternal:Caption = "Mod Clay".
        labelTool22:Tag = "Mod Clay.isl".
        appearance14:Image = CAST(resources:GetObject("appearance14.Image"), System.Object).
        labelTool24:SharedPropsInternal:AppearancesSmall:Appearance = appearance14.
        labelTool24:SharedPropsInternal:Caption = "Chameleon".
        labelTool24:Tag = "Chameleon.isl".
        appearance15:Image = CAST(resources:GetObject("appearance15.Image"), System.Object).
        labelTool26:SharedPropsInternal:AppearancesSmall:Appearance = appearance15.
        labelTool26:SharedPropsInternal:Caption = "Aero".
        labelTool26:Tag = "Aero.isl".
        @VisualDesigner.FormMember (NeedsInitialize="false", InitializeArray="true").
        DEFINE VARIABLE arrayvar6 AS Infragistics.Win.UltraWinToolbars.ToolBase EXTENT 15 NO-UNDO.
        arrayvar6[1] = buttonTool6.
        arrayvar6[2] = buttonTool8.
        arrayvar6[3] = labelTool2.
        arrayvar6[4] = labelTool4.
        arrayvar6[5] = labelTool6.
        arrayvar6[6] = labelTool8.
        arrayvar6[7] = labelTool10.
        arrayvar6[8] = labelTool14.
        arrayvar6[9] = buttonTool31.
        arrayvar6[10] = labelTool16.
        arrayvar6[11] = labelTool18.
        arrayvar6[12] = labelTool20.
        arrayvar6[13] = labelTool22.
        arrayvar6[14] = labelTool24.
        arrayvar6[15] = labelTool26.
        THIS-OBJECT:ultraToolbarsManager1:Tools:AddRange(arrayvar6).
        THIS-OBJECT:ultraToolbarsManager1:ToolClick:Subscribe(THIS-OBJECT:Trendy_btn).
        THIS-OBJECT:ultraToolbarsManager1:ToolDoubleClick:Subscribe(THIS-OBJECT:Rubber_btn


[code for styling method]
@VisualDesigner.
 METHOD PRIVATE VOID Trendy_btn(INPUT sender AS System.Object, INPUT e AS Infragistics.Win.UltraWinToolbars.ToolClickEventArgs):
     DEFINE VARIABLE vStyle AS CHARACTER NO-UNDO.
      setGStyle("C:\Projects\CustomerApplication\src\Styles\Trendy.isl" + vStyle).
 
    END METHOD.

My aim here want to each toolbar to have its own style, how do I do this? please help, thanks.
 

Osborne

Active Member
I do not know if this possible with Infragistics controls, but one thing you can do with standard .NET controls is read all that exist on a form and set properties that way. If it also works with Infragistics controls you would only require a single set of workings to apply for all the toolbars.

This article shows how to loop through form .NET controls, and although the article is actually disposing controls just adapt to set if a toolbar:

Progress KB - Error: "System.InvalidOperationException: Operation is not valid due to the current state of the object" shown when closing form
 

Mkontwg

Member
I do not know if this possible with Infragistics controls, but one thing you can do with standard .NET controls is read all that exist on a form and set properties that way. If it also works with Infragistics controls you would only require a single set of workings to apply for all the toolbars.

This article shows how to loop through form .NET controls, and although the article is actually disposing controls just adapt to set if a toolbar:

Progress KB - Error: "System.InvalidOperationException: Operation is not valid due to the current state of the object" shown when closing form
Will have a look and try to apply the logic, relevant to this above logic and make necessary changes if possible. Thanks.
 
Top