I can't seem to find anywhere how once I have created a style in the AppStylist to integrate it into my application.
There are samples of loading a Style Library into memory, and even of changing the library dynamically at run-time. The samples are included in the NetAdvantage SDK.
But to give you the short answer, you use the static StyleManager.Load method and pass in the filename of your isl file.
Hi, I found it thanks. But I have another question, is there a way to see the .isl file that is actually loaded?
It depends what you mean. There are methods on the StyleManager to get the current style information. But it doesn't keep any connection to the file that was loaded. The styling information in memory is not using the file, it just loads that file into memory and that's it.
That answers it...I am indexing the file names and controlling what the last loaded style was through a property.Ok, so one last style question - I have a Ultrapicturebox on top of an Ultragrid which is on the shared controls page of an UltraTabControl.
I want the picturebox background to match the ultragridbackground. When I set this in the form constructor the Ultragrid, is showing NO background color...how can I get the ultragrid background color when I am using stylemanager to load my styles?
upbType.BackColor = ugSqlBuild.DisplayLayout.Appearance.BackColor
Okay, as I'm sure you have realized, you can't use the Appearance property on the grid. Even if you were not using AppStyling, that would not work. Appearance.BackColor will only return whatever you set on it and not the actual on-screen color that the grid is displaying. This is true for any appearance, because appearances are resolved on many levels and the Appearance has to return when a property has no actually been set.
To get the actual appearance of anything in the grid, you need to use a method that resolves it. These methods are typically named along the lines of "ResolveAppearance" or "ResolveCellAppearance", etc.
In this case, I think you want something like this:
AppearanceData appData = new AppearanceData(); AppearancePropFlags flags = AppearancePropFlags.BackColor; this.ultraGrid1.DisplayLayout.ResolveLayoutAppearance(ref appData, ref flags, true); Debug.WriteLine(appData.BackColor);