windowsforms-devexpress-dot-xtramap-dot-mapshape.md
Provides access to the options that define the visibility, text and appearance of a shape title.
Namespace : DevExpress.XtraMap
Assembly : DevExpress.XtraMap.v25.2.dll
NuGet Package : DevExpress.Win.Map
public ShapeTitleOptions TitleOptions { get; }
Public ReadOnly Property TitleOptions As ShapeTitleOptions
| Type | Description |
|---|---|
| ShapeTitleOptions |
A ShapeTitleOptions object.
|
This example demonstrates how to customize shape title options. To do this, customize the required properties from the following list.
ShapeTitleOptions.Pattern - specifies the Pattern used to construct title text.
ShapeTitleOptions.TextColor - specifies the title text color.
ShapeTitleOptions.TextGlowColor - specifies the glow color for the title text.
ShapeTitleOptions.Visibility - specifies title visibility.
using System.Drawing;
using System.Windows.Forms;
using DevExpress.XtraMap;
// ...
private void Form1_Load(object sender, System.EventArgs e) {
MapItemStorage storage = new MapItemStorage();
VectorItemsLayer layer = new VectorItemsLayer() {
Data = storage
};
dot = new MapDot() { Size = 100 };
dot.TitleOptions.TextColor = Color.Orange;
dot.TitleOptions.TextGlowColor = Color.Black;
dot.TitleOptions.Pattern = "{Title}";
dot.Attributes.Add(new MapItemAttribute() { Name = "Title", Value = "Hello,\nI am Dot." });
storage.Items.Add(dot);
mapControl1.Layers.Add(layer);
}
Imports System.Drawing
Imports System.Windows.Forms
Imports DevExpress.XtraMap
' ...
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim storage As New MapItemStorage()
Dim layer As New VectorItemsLayer() With {.Data = storage}
dot = New MapDot() With {.Size = 100}
dot.TitleOptions.TextColor = Color.Orange
dot.TitleOptions.TextGlowColor = Color.Black
dot.TitleOptions.Pattern = "{Title}"
dot.Attributes.Add(New MapItemAttribute() With {.Name = "Title", .Value = "Hello," & ControlChars.Lf & "I am Dot."})
storage.Items.Add(dot)
mapControl1.Layers.Add(layer)
End Sub
See Also