I am new the navigating this website and the Infragistics controls and was wondering how I can switch between StyleSets at runtime
I am loading my ISL file on application startup:
Dim defaultTheme As System.IO.Stream = executingAssembly.GetManifestResourceStream("MyApp.Default.isl")
If defaultTheme IsNot Nothing Then
Infragistics.Win.AppStyling.StyleManager.Load(defaultTheme)
End If
I've done some more digging and I tried this:
If String.IsNullOrEmpty(Infragistics.Win.AppStyling.StyleManager.DefaultStyleSetName) _
OrElse Infragistics.Win.AppStyling.StyleManager.DefaultStyleSetName.Equals("Default") Then
Infragistics.Win.AppStyling.StyleManager.SetDefaultStyleSetName(Nothing, "White")
Else
Infragistics.Win.AppStyling.StyleManager.SetDefaultStyleSetName(Nothing, "Default")
[NameOfInfragisticsControl].StyleSetName = "White"
[NameOfInfragisticsControl].StyleSetName = String.Empty
This is no good for me as I want to be able to change the background (for example) by a single click for all Infragistics controls.
I'm not sure I follow what you are trying to do. It looks like your first example is changing the BackColor of the form. No property settings on the form or any controls will affect the style. The Style will, in fact, override these settings.
If you want to load a new StyleLibrary into your application, then you would just call StyleManager.Load and pass in a different file.
If you want to modify the StyleLibrary currently in memory in code, then this is quite complex and difficult. You would have to change the colors on a huge range of UIRoles to get your whole application to be consistent. It is possible to do this in code, though, if you really want to try it.
Here's a post that deals with something very similar, changing the font: Change font at runtime - Infragistics Forums