ArcObjects Library Reference (Carto)  

IMapFrame.CreateSurroundFrame Method

Returns the map surround frame element of the type given in clsid. An optional style object may be specified.

[Visual Basic .NET]
Public Function CreateSurroundFrame ( _
    ByVal clsid As UID, _
    ByVal optionalStyle As IMapSurround _
) As IMapSurroundFrame
[C#]
public IMapSurroundFrame CreateSurroundFrame (
    UID clsid,
    IMapSurround optionalStyle
);
[C++]
HRESULT CreateSurroundFrame(
  IUID* clsid,
  IMapSurround* optionalStyle,
  IMapSurroundFrame** MapSurroundFrame
);
[C++]

Parameters

clsid [in]

  clsid is a parameter of type IUID

optionalStyle [in]

  optionalStyle is a parameter of type IMapSurround

MapSurroundFrame [out, retval]

  MapSurroundFrame is a parameter of type IMapSurroundFrame

Product Availability

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

Remarks

CreateSurroundFrame is used to create a new map surround element (north arrow, scale bar, etc.) based on the current map frame.  For instance, if I create a new scale bar with CreateSurroundFrame, the scale bar will be related to the map frame and updates to the map within the frame will be reflected in the scale bar.

Use this method when you want to create a new map surround object related to the current map frame.

THE CLSID paramter refers to the Class ID of the object that will be created and housed in the frame.  Common Class IDs used in this paramter are:

{6589F147-F7F7-11d2-B872-00600802E603} AlternatingScaleBar

{6589F148-F7F7-11d2-B872-00600802E603} DoubleAlternatingScaleBar

{6589F143-F7F7-11d2-B872-00600802E603} HollowScaleBar

{7A3F91E4-B9E3-11d1-8756-0000F8751720} Legend

{7A3F91E3-B9E3-11d1-8756-0000F8751720} MapInset

{7A3F91DF-B9E3-11d1-8756-0000F8751720} MapTitle

{7A3F91DD-B9E3-11d1-8756-0000F8751720} MarkerNorthArrow

{7A3F91DE-B9E3-11d1-8756-0000F8751720} Overview

{6589F140-F7F7-11d2-B872-00600802E603} ScaleLine

{7A3F91DC-B9E3-11d1-8756-0000F8751720} ScaleText

{6589F146-F7F7-11d2-B872-00600802E603} SingleDivisionScaleBar

{6589F141-F7F7-11d2-B872-00600802E603} SteppedScaleLine

See Also

IMapFrame Interface

.NET Snippets

Add Scale Bar | Add Legend | Add North Arrow

.NET Samples

Update a legend format with SymbologyControl area and line patches (Code Files: AreaLinePatches)

.NET Related Topics

Working with map surrounds