Hello,
I am using the AppStylist in a Windows Forms application. The style I am using is stored in a subdirectory, and at program start I am using this code to access the style:
Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Infragistics.Win.AppStyling.StyleManager.Load("Styles/Office2007Blue_Modified.isl");
The "Copy to output directory" attribute of the file is set to "Copy if newer" and running this code to initialize the styles has never been a problem.
Now that I publish my application using the "Publish" feature of the Windows Forms project (with feature "always run from shared path") and publish the application to a shared drive (or local drive for that matter) and run the application, it seems that the application can not find the style file and I get the exception:
Could not find a part of the path: "c:\documents and settings\myusername\Local Settings\Apps\2.0\97NE5X9H.DNB\K0DC3B00\vord..tion_{some cryptic hex coded string}\Styles\Office2007Blue_modified.isl".
Is there a way to fix this?
Markus
I can confirm that the above solution works
Markus...
For Click-once deployment
After adding the isl file - "AppStyleGlow.isl" as "Existing Item" from solution bar.
Right click on the properties and set
Build Action = Content
Copy to Output directory = Copy if newer
and then add the following line in form load.
Infragistics.Win.AppStyling.StyleManager.Load(CurDir() & "\AppStyleGlow.isl")
This should work...
Markus,
I don't really have any experience with ClickOnce deployment, but instead of worry about whether a file is copied upon deployment, you might find it a lot easier to simply embed the ISL into your application and then load it from a memory stream (i.e. Assembly.GetExecutingAssembly().GetManifestResourceStream()). In order to do this you would have to set the ISL to be an Embedded Resource.
-Matt