Back to Devexpress

TreeMapItemLeafStyle.LabelAlignment Property

windowsforms-devexpress-dot-xtratreemap-dot-treemapitemleafstyle-ab3fc4c5.md

latest4.6 KB
Original Source

TreeMapItemLeafStyle.LabelAlignment Property

Gets or sets the alignment for treemap item labels.

Namespace : DevExpress.XtraTreeMap

Assembly : DevExpress.XtraTreeMap.v25.2.dll

NuGet Package : DevExpress.TreeMap

Declaration

csharp
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
[XtraSerializableProperty(XtraSerializationFlags.LoadOnly)]
public StringAlignment LabelAlignment { get; set; }
vb
<XtraSerializableProperty(XtraSerializationFlags.LoadOnly)>
<Browsable(False)>
<EditorBrowsable(EditorBrowsableState.Never)>
Public Property LabelAlignment As StringAlignment

Property Value

TypeDescription
StringAlignment

The alignment of treemap labels.

|

Remarks

Note

Use the TreeMapItemLeafStyle.DXLabelAlignment property instead of LabelAlignment in non-Windows environments.

Example

This example demonstrates how to customize a treemap’s appearance.

The TreeMapControl.Appearance property provides access to the treemap’s appearance options.

csharp
treeMapControl1.Appearance.GroupStyle.BorderColor = Color.Red;
treeMapControl1.GroupBorderVisible = DevExpress.Utils.DefaultBoolean.True;
treeMapControl1.Appearance.GroupStyle.Fill = Color.SlateGray;
treeMapControl1.Appearance.GroupStyle.Padding = new Padding(4);
treeMapControl1.Appearance.GroupStyle.DXLabelAlignment = DXStringAlignment.Center;
treeMapControl1.Appearance.GroupStyle.Font = new Font(FontFamily.GenericSerif, 20);
treeMapControl1.Appearance.GroupStyle.TextColor = Color.White;
treeMapControl1.Appearance.GroupStyle.SubGroupFont = new Font(FontFamily.GenericSerif, 14);
treeMapControl1.Appearance.GroupStyle.SubGroupTextColor = Color.DarkSlateGray;

treeMapControl1.Appearance.LeafStyle.BorderColor = Color.Green;
treeMapControl1.Appearance.LeafStyle.DXLabelAlignment = DXStringAlignment.Near;
treeMapControl1.Appearance.LeafStyle.TextGlowColor = Color.Transparent;
treeMapControl1.Appearance.LeafStyle.TextColor = Color.Blue;

treeMapControl1.Appearance.HighlightedLeafStyle.FillStyle = new HatchFillStyle { 
    DXHatchStyle = DevExpress.Drawing.DXHatchStyle.Percent50, 
    Color2 = Color.Transparent 
};
vb
TreeMapControl1.Appearance.GroupStyle.BorderColor = Color.Red
TreeMapControl1.GroupBorderVisible = DevExpress.Utils.DefaultBoolean.[True]
TreeMapControl1.Appearance.GroupStyle.Fill = Color.SlateGray
TreeMapControl1.Appearance.GroupStyle.Padding = New Padding(4)
TreeMapControl1.Appearance.GroupStyle.DXLabelAlignment = DXStringAlignment.Center
TreeMapControl1.Appearance.GroupStyle.Font = New Font(FontFamily.GenericSerif, 20)
TreeMapControl1.Appearance.GroupStyle.TextColor = Color.White
TreeMapControl1.Appearance.GroupStyle.SubGroupFont = New Font(FontFamily.GenericSerif, 14)
TreeMapControl1.Appearance.GroupStyle.SubGroupTextColor = Color.DarkSlateGray
TreeMapControl1.Appearance.LeafStyle.BorderColor = Color.Green
TreeMapControl1.Appearance.LeafStyle.DXLabelAlignment = DXStringAlignment.Near
TreeMapControl1.Appearance.LeafStyle.TextGlowColor = Color.Transparent
TreeMapControl1.Appearance.LeafStyle.TextColor = Color.Blue
TreeMapControl1.Appearance.HighlightedLeafStyle.FillStyle = New HatchFillStyle With {
    .DXHatchStyle = DevExpress.Drawing.DXHatchStyle.Percent50,
    .Color2 = Color.Transparent
}

See Also

TreeMapItemLeafStyle Class

TreeMapItemLeafStyle Members

DevExpress.XtraTreeMap Namespace