This document is archived and information here might be outdated.  Recommended version.


IMap.CreateMapSurround Method (ArcObjects .NET 10.4 SDK)
ArcObjects Library Reference (Carto)  

IMap.CreateMapSurround Method

Create and initialize a map surround. An optional style from the style gallery may be specified.

[Visual Basic .NET]
Public Function CreateMapSurround ( _
    ByVal CLSID As UID, _
    ByVal optionalStyle As IMapSurround _
) As IMapSurround
[C#]
public IMapSurround CreateMapSurround (
    UID CLSID,
    IMapSurround optionalStyle
);
[C++]
HRESULT CreateMapSurround(
  IUID* CLSID,
  IMapSurround* optionalStyle,
  IMapSurround** MapSurround
);
[C++]

Parameters CLSID [in]
CLSID is a parameter of type IUID optionalStyle [in]
optionalStyle is a parameter of type IMapSurround MapSurround [out, retval]
MapSurround is a parameter of type IMapSurround

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Remarks

The CreateMapSurround method creates a new MapSurround object based on the required GUID parameter.  The optional style parameter specifies a partially initialized surround that comes from the style gallery.  For example, there are an entire collection of north arrows in the style gallery, use this parameter to specify the desired one.
CreateMapSurround automatically calls AddMapSurround to associate the new surround with the Map.
In the ArcMap application, the model for MapSurround objects is that each surround is contained by a separate MapSurroundFrame which has a relation to a MapFrame which holds the Map.  The CreateMapSurround method does not follow this model and is exposed for developers who want to create surrounds in a different window.  To keep with ArcMap's surround model, use IMapFrame::CreateSurroundFrame.  This method automatically creates a new MapSurroundFrame object with a MapSurround and associates them with the Map.

See Also

IMap Interface | IMapFrame.CreateSurroundFrame Method | IMap.CreateMapSurround Method | IMap.AddMapSurround Method | IMap.ClearMapSurrounds Method | IMap.DeleteMapSurround Method