TextBlock.BaselineOffset 属性

定义

获取或设置文本的每个行相对于基线的偏移量。Gets or sets the amount by which each line of text is offset from the baseline.

public:
 property double BaselineOffset { double get(); void set(double value); };
public double BaselineOffset { get; set; }
member this.BaselineOffset : double with get, set
Public Property BaselineOffset As Double

属性值

文本的每个行相对于基线的偏移量,以与设备无关的像素为单位。The amount by which each line of text is offset from the baseline, in device independent pixels. NaN 表示将根据当前的字体特征自动计算最佳基线偏移量。NaN indicates that an optimal baseline offset is automatically calculated from the current font characteristics. 默认值为 NaNThe default is NaN.

注解

基线是文本行中每个字符的基与之对齐的虚部。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. XAMLXAML中,使用情况是 <object TextBlock.BaselineOffset="double".../>的,其中object是包含在 TextBlock内的对象元素(通常是 flow 元素)。In XAMLXAML, the usage is <object TextBlock.BaselineOffset="double".../>, where object is an object element (typically a flow element) contained within a TextBlock. 在代码中,GetBaselineOffsetSetBaselineOffset支持附加的属性用法。In code, the attached property usage is supported by GetBaselineOffset and SetBaselineOffset.

适用于