TextBlock.BaselineOffset Property


Returns a value by which each line of text is offset from a baseline.

 property double BaselineOffset { double get(); };
double BaselineOffset();
public double BaselineOffset { get; }
var double = textBlock.baselineOffset;
Public ReadOnly Property BaselineOffset As Double

Property Value



The amount by which each line of text is offset from the baseline, in device independent pixels. The default is NaN. See Remarks below.


If the BaselineOffset is NaN, then an optimal baseline offset is automatically calculated from the current font characteristics.


In C#, you can obtain NaN from Double.NaN.

In C++, you can obtain NaN by using the NAN macro or std::numeric_limits<double>::quiet_NaN().

Do not use the == operator to test for NaN.

In C#, use Double.IsNaN() to test for NaN.

In C++, use isnan() to test for NaN.

Applies to