Is there a way to load the style at design time (in visual studio)?
Very clever solution. :)
gone2mars said:God knows why Infragistics have never put this in
Note sure what you mean by that, exactly. Since this requires deriving your own special Form class, there's not much we can do there.
But if by "put this in" you mean put it into the docs or provide examples of this, it simply never occurred to me, personally.
Very good.
I confirm, it's working well.
Thanks.
I don't know why Infragistics Mike is saying it can't be done, thats complete croc as i've been doing it since developing my current application ... starting 2 years ago??
The most common way to do this is to create a new form, i call it FrmDesignTimeAppStylist, inside it create an AppStylistRuntime control. You might have to reference the infragistics library.
One you've done this, open up the FrmDesignTimeAppStylist.Designer.vb (you might need to enable 'Show All Files') and inside the 'InitializeComponent' sub create the follwing line right at the end:
Me.AppStylistRuntime1.ShowRuntimeApplicationStylingEditor(Me, "test")
Save and Close the form.
Now everytime you load the form the app stylist will show, click load and select your style .. once loaded simply close the appstylist popup and your form ... the rest of your forms (and any you load) will have your styles loaded.
God knows why Infragistics have never put this in and i've seen many post by them saying it can't be done? Because the styles change absolutely everything including control sizes, it makes designing a complicated form near impossible unless you do this.
Oh, And if they ever take the functionality out to do this, my subscription will immediately end.
The above sample can be changed to simply use a Component instead of a UserControl, since you don't really need a control on the form to load the library. If you add a new Component to your project, add the Style property as mentioned above:
private string m_style;public string Style{ get { return m_style; } set { m_style = value; Infragistics.Win.AppStyling.StyleManager.Load(m_style); }}
After this build your component and add it to your form. Assigning the path of an ISL file was correctly reflected at design-time in my application.
-Matt
Ok, thank you sir.