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


Toggle to Dynamic Display Snippet (ArcObjects .NET 10.4 SDK)
ArcObjects Library Reference

Toggle to Dynamic Display Snippet

Switch from Map Display to Dynamic Display.

[C#]
///<summary>Switch from Map Display to Dynamic Display.</summary>
///  
///<param name="map">An IMap interface.</param>
///   
///<remarks></remarks>
public void ToggleToDynamicDisplay(ESRI.ArcGIS.Carto.IMap map)
{
  //make sure to switch into dynamic mode
  ESRI.ArcGIS.Carto.IDynamicMap dynamicMap=map as ESRI.ArcGIS.Carto.IDynamicMap;

  //make sure that the current Map supports the DynamicDisplay
  if (null == dynamicMap)
    return;
 
  //switch into dynamic mode
  if (!dynamicMap.DynamicMapEnabled)
    dynamicMap.DynamicMapEnabled=true;
}
[Visual Basic .NET]
'''<summary>Switch from Map Display to Dynamic Display.</summary>
'''  
'''<param name="map">An IMap interface.</param>
'''   
'''<remarks></remarks>
Public Sub ToggleToDynamicDisplay(ByVal map As ESRI.ArcGIS.Carto.IMap)

  'make sure to switch into dynamic mode
  Dim dynamicMap As ESRI.ArcGIS.Carto.IDynamicMap=TryCast(map, ESRI.ArcGIS.Carto.IDynamicMap) ' Dynamic Cast

  'make sure that the current Map supports the DynamicDisplay
  If Nothing Is dynamicMap Then

    Return

  End If

  'switch into dynamic mode
  If (Not dynamicMap.DynamicMapEnabled) Then

    dynamicMap.DynamicMapEnabled=True

  End If

End Sub

Additional Requirements
  • The code in this document requires the following References added to the Visual Studio project:
  • ESRI.ArcGIS.Carto