Update a frame's background, border, and shadow using the SymbologyControl


Purpose
This sample demonstrates using the SymbologyControl to update frame properties. The sample uses the SymbologyControl in conjunction with the PageLayoutControl, ToolbarControl, and the controls commands.

How to use

See How to use ArcGIS samples for help on compiling, setting up the debugger, and running the sample. If the sample has associated data, you will find that the sample's zip file includes a "data" folder alongside the language folders. However, you will need to update the sample to point to the location of the data once you have extracted all the files.

  1. Load a map document into the PageLayoutControl.
  2. Change the page properties using the combo box and the items shown in the SymbologyControl.

Additional information

The LoadStyleFile method is used within the Form_Load event to add the contents of the ESRI.ServerStyle into the SymbologyControl. A combo box is populated with background, border, and shadow items. The SelectedIndexChanged event of the combo box is used to set the type of items displayed in the SymbologyControl using the StyleClass property.
Clicking an item shown in the SymbologyControl fires the OnItemSelectedEvent. The IStyleGalleryItem.Item property is used to determine whether the item implements IBackground, IBorder, or IShadow, then the IFrameProperties, Background, Border, or Shadow property is set. The frame properties of the MapFrame containing the FocusMap are updated.
Loading a map document into the PageLayoutControl fires the OnPageLayoutReplaced event. If the frame properties of the MapFrame containing the FocusMap are set, a new ServerStyleGalleryItem is created with the name set to "myStyle" and the item set to the Background, Border, or Shadow. The ServerStyleGalleryItem is added to the appropriate StyleClass using the ISymbologyStyleClass.AddItem method.


AssemblyInfo.cs Assembly information.
FrameProperties.cs Form file.
Download the C# files
AssemblyInfo.vb Assembly information.
FrameProperties.vb Form file.
Download the VB.NET files

Download the files for all languages

See Also:

SymbologyControl Class
ISymbologyControl Interface
ISymbologyStyleClass Interface




Development licensing Deployment licensing
Engine Developer Kit Engine
ArcGIS for Desktop Basic
ArcGIS for Desktop Standard
ArcGIS for Desktop Advanced