ArcMap で DynamicDisplay を有効にする方法

'あらかじめUIButtonControlを作成しておくこと
'(VBEditorを閉じないとボタンが押された表示にならない)

Private Function UIButtonControl1_Checked() As Boolean
   'Query IMxDocument from the current document
   Dim pMxDoc As IMxDocument
   Set pMxDoc = ThisDocument
   
   'Query IDynamicMap from the current map
   Dim pDynamicMap As IDynamicMap
   Set pDynamicMap = pMxDoc.ActiveView.FocusMap
   
   'Return the state of the DynamicMapEnabled
   ToggleDynamicDisplay_Checked = pDynamicMap.DynamicMapEnabled
End Function


Private Sub UIButtonControl1_Click()
  'Query IMxDocument from the current document
   Dim pMxDoc As IMxDocument
   Set pMxDoc = ThisDocument
   
   'Query IDynamicMap from the current map
   Dim pDynamicMap As IDynamicMap
   Set pDynamicMap = pMxDoc.ActiveView.FocusMap
   
   'Toggle the DynamicMap on/off
   pDynamicMap.DynamicMapEnabled = Not pDynamicMap.DynamicMapEnabled

   pDynamicMap.DynamicDrawRate = 30
   pDynamicMap.UseSubPixelRendering = True

End Sub