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.
Hello Bharat,
When loading AppStyle, you could apply it to all Infragistics controls into your application or only to specific IG controls. Also you are able to load more than one AppStyle and after that you could choose which AppStyle to be used from each of IG controls.
Bharat Jangir said:Is there a way to apply it only on one form or a few forms
Let me know if you have any questions.
Hi Georgi,
In my application some forms are made from IG controls and some are IG controls + windows controls(mixed). So I want to apply AppStyle with some specific forms (forms that only made from IG controls).
Thanks
Bharat
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); } }
HI,
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?
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.
I see that the above method that you described was posted in 2013.
Is this still how you would recommend setting the stylesets problematically?
Yes, nothing related to this had changed in the intervening years.