Floater.HorizontalAlignment Property

Definition

Gets or sets a value that indicates the horizontal alignment for a Floater object.

C#
public System.Windows.HorizontalAlignment HorizontalAlignment { get; set; }

Property Value

A member of the HorizontalAlignment enumeration specifying the horizontal alignment for the Floater. The default is Stretch.

Examples

The following example shows how to set this property.

XAML
<FlowDocument>
  <Paragraph>
    <Floater
      Name="myFloater"              
      Width="140" 
      HorizontalAlignment="Left"
    />
  </Paragraph>
</FlowDocument>
C#
Floater flotx = new Floater();
flotx.Name = "myFloater";
flotx.Width = 100;
flotx.HorizontalAlignment = HorizontalAlignment.Left;

Paragraph parx = new Paragraph(flotx);
FlowDocument flowDoc = new FlowDocument(parx);

Remarks

Dependency Property Information

Item Value
Identifier field HorizontalAlignmentProperty
Metadata properties set to true AffectsMeasure, AffectsArrange

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