This document is archived and information here might be outdated. Recommended version. |
Loads a desktop style file into the SymbologyControl.
[Visual Basic .NET]
Public Sub LoadDesktopStyleFile ( _
ByVal fileName As String _
)
[C#]
public void LoadDesktopStyleFile (
string fileName
);
[C++]
HRESULT LoadDesktopStyleFile(
BSTR fileName
);
[C++] Parameters fileName [in]
fileName is a parameter of type BSTR
Loads the contents of the specified style file (*.Style) into the SymbologyControl. Where possible always use the LoadStyleFile method to load the contents of server style files (*.ServerStyle) into the SymbologyControl, as style files are only supported with an ArcGIS for Desktop installation.
Each StyleGalleryItem within the style file is added to a SymbologyStyleClass based on its type. For example, a SimpleFillSymbol will be added to the esriStyleClassFillSymbols SymbologyStyleClass.
Items are 'demand loaded' to the end of a SymbologyStyleClass item collection. This is done to increase performance and means items are only loaded into a SymbologyStyleClass when it is the current StyleClass, or when the SymbologyStyleClass is being accessed programmatically. To force items to be loaded into a SymbologyStyleClass when it is not the current StyleClass, use the ISymbologyStyleClass::Update method.
Passing the same style file to the LoadDesktopStyleFile method multiple times within the lifetime of an application, causes the contents of the style file to reload into the SymbologyControl.
1054 800a041e: The specified filename is invalid.
1075 800a0433: ArcGIS for Desktop is not installed on this machine so Style files cannot be read.
1077 800a0435: The file is not recognized as a Style file.
A 'desktop' Style file is similar to a Server Style file, except is has a .Style extension rather than a .ServerStyle extension. Style files are available to ArcGIS for Desktop products only, whereas Server Style files are available to all ArcGIS products.