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