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
Thanks Mike, I would also like to mention a workaround which we used.
If we load all the style libraries with some alias name then the style libraries are not loaded to any control where the property StyleLibraryName is not set .
So we are now only assigning the property on the forms where we want it to load the library.
Hi,
If you need any additional assistance don’t hesitate to ask.
Regards
Hi Mike,
If I want to set the stlylesetname of all the infragistics controls on a form to a specific name. Do we have a base class which we should use to set the stylesetname?
Thanks,Puneet
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?
Yes, nothing related to this had changed in the intervening years.
I see that the above method that you described was posted in 2013.
Is this still how you would recommend setting the stylesets problematically?
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.