TextBlock.BaselineOffset Property

Definition

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Gets or sets the amount by which each line of text is offset from the baseline.

C#
public double BaselineOffset { get; set; }

Property Value

The amount by which each line of text is offset from the baseline, in device independent pixels. NaN indicates that an optimal baseline offset is automatically calculated from the current font characteristics. The default is NaN.

Remarks

The baseline is the imaginary horizontal line with which the base of each character in a line of text is aligned.

This dependency property also has an attached property usage. In XAML, the usage is <object TextBlock.BaselineOffset="double".../>, where object is an object element (typically a flow element) contained within a TextBlock. In code, the attached property usage is supported by GetBaselineOffset and SetBaselineOffset.

Applies to

Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10