Back to Devexpress

Title.Dock Property

windowsforms-devexpress-dot-xtratreemap-dot-title.md

latest3.7 KB
Original Source

Title.Dock Property

Gets or sets the control’s edge to which the title is docked.

Namespace : DevExpress.XtraTreeMap

Assembly : DevExpress.XtraTreeMap.v25.2.dll

NuGet Package : DevExpress.TreeMap

Declaration

csharp
[XtraSerializableProperty]
public TitleDockStyle Dock { get; set; }
vb
<XtraSerializableProperty>
Public Property Dock As TitleDockStyle

Property Value

TypeDescription
TitleDockStyle

Specifies how the title is arranged within the control.

|

Available values:

NameDescriptionImage
Top

A title is positioned at the top of the chart.

|

| | Bottom |

A title is positioned at the bottom of the chart.

|

| | Left |

A title is positioned to the left of the chart.

|

| | Right |

A title is positioned to the right of the chart.

|

|

Example

How to: Add Multiple Titles to a TreeMap

This example adds two titles to a treemap and customizes title content, font, and alignment.

  1. Create a Title object.

  2. Specify the following settings to customize the title’s content, alignment, text color, and font:

  3. Add the title to the treemap’s Titles collection.

Repeat the steps to add another title.

csharp
using DevExpress.XtraTreeMap;
using System;
using System.Drawing;
using System.Windows.Forms;
//...
private void Form1_Load(object sender, EventArgs e) {
  //...
  // Add and customize the first title.
  Title title = new Title();
  title.Text = "US Largest Companies";
  title.Dock = TitleDockStyle.Top;
  title.TextColor = Color.Black;
  title.DXFont = new DXFont("Tahoma", 16);
  treeMapControl1.Titles.Add(title);

  // Add and customize the second title.
  Title subtitle = new Title();
  subtitle.Text = "in 2011";
  subtitle.Dock = TitleDockStyle.Top;
  subtitle.TextColor = Color.DarkGray;
  subtitle.DXFont = new DXFont("Tahoma", 11);
  treeMapControl1.Titles.Add(subtitle);
}
vb
Imports DevExpress.XtraTreeMap
Imports System
Imports System.Drawing
Imports System.Windows.Forms
'...
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
  '...
  ' Add and customize the first title.
  Dim title As Title = New Title()
  title.Text = "US Largest Companies"
  title.Dock = TitleDockStyle.Top
  title.TextColor = Color.Black
  title.DXFont = New DXFont("Tahoma", 16)
  treeMapControl1.Titles.Add(title)

  ' Add and customize the second title.
  Dim subtitle As Title = New Title()
  subtitle.Text = "in 2011"
  subtitle.Dock = TitleDockStyle.Top
  subtitle.TextColor = Color.DarkGray
  subtitle.DXFont = New DXFont("Tahoma", 11)
  treeMapControl1.Titles.Add(subtitle)
End Sub

See Also

Title Class

Title Members

DevExpress.XtraTreeMap Namespace