{
//Create a dynamic text element.
//Set the string with tags and the location
String title = @"<dyn type = ""page"" property = ""name"" />";
Coordinate2D llTitle = new Coordinate2D(6, 2.5);
//Create with default text properties
//Note: Must be on QueuedTask.Run
TextElement titleGraphics = ElementFactory.Instance.CreateTextGraphicElement(
layout, TextType.PointText, llTitle.ToMapPoint(), null, title) as TextElement;
//Modify the text properties
titleGraphics.SetTextProperties(new TextProperties(title, "Arial", 24, "Bold"));
}
System.Object
ArcGIS.Desktop.Layouts.TextProperties
Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)