You are here: > ESRI Forums > arcgis desktop discussion forums > Thread Replies

ArcGIS Desktop Discussion Forums

ArcGIS Desktop - ArcObjects Visual Basic for Application (VBA) forum

Label a feature layer using fields values   Demetris Demetriou May 01, 2008
Re: Label a feature layer using fields valu...   Neil Clemmons May 01, 2008
Re: Label a feature layer using fields valu...   Demetris Demetriou May 01, 2008
Re: Label a feature layer using fields valu...   Francis Sacdalan May 01, 2008
Re: Label a feature layer using fields valu...   Demetris Demetriou May 01, 2008
Re: Label a feature layer using fields valu...   Francis Sacdalan May 01, 2008
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Label a feature layer using fields values 
Author Demetris Demetriou 
Date May 01, 2008 
Message Hi,
My question is: How can I label a feature layer using the values of two fields?
Thanks
Demetris 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Label a feature layer using fields values 
Author Neil Clemmons 
Date May 01, 2008 
Message Set the label expression to be the concatenation of the two fields. The code below is VB.NET but it translates easy enough. 
 
Dim geoFeatureLayer As IGeoFeatureLayer = CType(featureLayer, IGeoFeatureLayer)
            Dim annoLayerProps As IAnnotateLayerProperties = Nothing
            geoFeatureLayer.AnnotationProperties.QueryItem(0, annoLayerProps)
            Dim labelEngineProps As ILabelEngineLayerProperties = CType(annoLayerProps, ILabelEngineLayerProperties)
            labelEngineProps.Expression = "[field1] + [field2]"
 
  Neil Clemmons
Senior GIS Developer
Geographic Information Services, Inc.
Birmingham, AL
http://www.gis-services.com

Check out our blog:
http://blog.gis-services.com/ 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Label a feature layer using fields values 
Author Demetris Demetriou 
Date May 01, 2008 
Message Thank you very much.
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Label a feature layer using fields values 
Author Francis Sacdalan 
Date May 01, 2008 
Message try this link

http://forums.esri.com/Thread.asp?c=93&f=993&t=204478

hope it helps. 
  Francis Sacdalan 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Label a feature layer using fields values 
Author Demetris Demetriou 
Date May 01, 2008 
Message Thank you very much.
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Label a feature layer using fields values 
Author Francis Sacdalan 
Date May 01, 2008 
Message try this link

http://forums.esri.com/Thread.asp?c=93&f=993&t=204478

hope it helps. 
  Francis Sacdalan