ESRI.ArcGIS.ADF.IMS
TextElement Constructor(String,AcetateUnits)
See Also  Example
ESRI.ArcGIS.ADF.IMS.Display.AcetateElement Namespace > TextElement Class > TextElement Constructor : TextElement Constructor(String,AcetateUnits)




label
The text to be displayed.
units
The AcetateUnits associated with this element.
Constructs a TextElement object.

Syntax

Visual Basic (Declaration) 
Public Function New( _
   ByVal label As String, _
   ByVal units As AcetateUnits _
)
Visual Basic (Usage)Copy Code
Dim label As String
Dim units As AcetateUnits
 
Dim instance As TextElement(label, units)
C# 
public TextElement( 
   string label,
   AcetateUnits units
)

Parameters

label
The text to be displayed.
units
The AcetateUnits associated with this element.

Example

The following example creates a text element, sets some of its properties, and adds it to the map. Note that only Location , Units and Label are required properties.
Visual BasicCopy Code
' Create an acetate layer and add it to the map

Dim aceLyr As New AcetateLayer("mapGraphics")

mapView.Layers.Add(aceLyr)



' Create a point to locate the text

Dim txtLocation As New Point(0, 0)



' Set up the text label for TextElement

Dim txtLabel As String = "New incident"



' Create the TextElement and set its properties

Dim txtElem As New TextElement(txtLabel, AcetateUnits.Database)

txtElem.Location = txtLocation

txtElem.Antialiasing = True

txtElem.AllowLabelOverlap = False

txtElem.Angle = 10

txtElem.BackColor = Drawing.Color.Beige

txtElem.Font = New FontInfo("Verdana", 18, Drawing.Color.Sienna, FontStyle.BoldItalic)

txtElem.GlowColor = Drawing.Color.AntiqueWhite

txtElem.HorizontalAlignment = HorizontalAlignment.Center

txtElem.Interval = 2

txtElem.OutlineColor = Drawing.Color.SandyBrown

txtElem.ShadowColor = Drawing.Color.LightGray

txtElem.TextCasing = TextCasing.AllUpper

txtElem.Transparency = 0.4

txtElem.VerticalAlignment = VerticalAlignment.Center



aceLyr.AcetateElements.Add(txtElem)

C#Copy Code
// Create an acetate layer and add it to the map 

AcetateLayer aceLyr = new AcetateLayer("mapGraphics"); 

mapView.Layers.Add(aceLyr); 

  

// Create a point to locate the text 

Point txtLocation = new Point(0, 0); 

  

// Set up the text label for TextElement 

String txtLabel = "New incident"; 

  

// Create the TextElement and set its properties 

TextElement txtElem = new TextElement(txtLabel, AcetateUnits.Database); 

txtElem.Location = txtLocation; 

txtElem.Antialiasing = true; 

txtElem.AllowLabelOverlap = false; 

txtElem.Angle = 10; 

txtElem.BackColor = Drawing.Color.Beige; 

txtElem.Font = new FontInfo("Verdana", 18, Drawing.Color.Sienna, FontStyle.BoldItalic); 

txtElem.GlowColor = Drawing.Color.AntiqueWhite; 

txtElem.HorizontalAlignment = HorizontalAlignment.Center; 

txtElem.Interval = 2; 

txtElem.OutlineColor = Drawing.Color.SandyBrown; 

txtElem.ShadowColor = Drawing.Color.LightGray; 

txtElem.TextCasing = TextCasing.AllUpper; 

txtElem.Transparency = 0.4; 

txtElem.VerticalAlignment = VerticalAlignment.Center; 

  

aceLyr.AcetateElements.Add(txtElem); 

    

Remarks

Location must also be specified in order to place the element on the map.

See Also

© 2010 All Rights Reserved.