ARCGIS ENGINE開發時如何改變標註欄位
阿新 • • 發佈:2019-02-04
pFLayer.DisplayField = "FID"
pFLayer.DisplayAnnotation = True
'假設pGLayer是一個有效的GeoFeatureLayer物件,下面的程式碼是把標註欄位改為要素類的中第四個欄位。
'注意:通過pFLayer.DisplayField 屬性來改變標註欄位是無效的。
Dim pAnnoLayerPropsColl As IAnnotateLayerPropertiesCollection
Set pAnnoLayerPropsColl = pGLayer.AnnotationProperties
pAnnoLayerPropsColl.Clear
' 建立一個新的 LabelEngineLayerProperties物件
Dim aLELayerProps As ILabelEngineLayerProperties
Set aLELayerProps = New LabelEngineLayerProperties
aLELayerProps.IsExpressionSimple = True
aLELayerProps.Expression = "[" & pFLayer.FeatureClass.Fields.Field(3).Name & "]"
pAnnoLayerPropsColl.Add aLELayerProps
'重新整理
MapControl1.ActiveView.PartialRefresh esriViewGeography + esriViewGraphics, Nothing, Nothing