When I am loading the isl file at runtime as shown in the samples, the style is loaded on whole application. Is there a way to apply it only on one form or a few forms.
Yes, nothing related to this had changed in the intervening years.
HI,
I see that the above method that you described was posted in 2013.
Is this still how you would recommend setting the stylesets problematically?
Thanks
Well... it's possible that this might miss some controls that are not directly on the form. Floating windows and dialogs and things like that.
It's also possible that there are some controls that support AppStylist but do not derive from UltraControlBase. And this does not account for any components on the form that would not be included in the Controls collection.
Can you explain why this would not be 100% effective?
I could see where there would be an issue if you have windows controls mixed up with Infragistics controls.
Are the any other issues that you are referring to?
Hi Puneet,
It's not 100% effective, but you can use 'UltraControlBase'. Here's a static method I use to handle this for StyleLibraryName, but you could easily just change StyleLibraryName to StyleSetname:
internal static void SetStyleLibraryName(Control control, string styleLibraryName) { UltraControlBase ultraControlBase = control as UltraControlBase; if (ultraControlBase != null) { ultraControlBase.StyleLibraryName = styleLibraryName; } UltraToolbarsDockArea ultraToolbarsDockArea = control as UltraToolbarsDockArea; if (ultraToolbarsDockArea != null) { UltraToolbarsManager ultraToolbarsManager = ultraToolbarsDockArea.ToolbarsManager; ultraToolbarsManager.StyleLibraryName = styleLibraryName; } foreach (Control childControl in control.Controls) { SetStyleLibraryName(childControl, styleLibraryName); } }