HorizontalAnchor Property
Collapse the table of content
Expand the table of content

Figure.HorizontalAnchor Property

Gets or sets a value that indicates the position that content is anchored to in the horizontal direction.

Namespace: System.Windows.Documents
Assembly: PresentationFramework (in presentationframework.dll)
XML Namespace:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

public FigureHorizontalAnchor HorizontalAnchor { get; set; }
/** @property */
public FigureHorizontalAnchor get_HorizontalAnchor ()

/** @property */
public void set_HorizontalAnchor (FigureHorizontalAnchor value)

public function get HorizontalAnchor () : FigureHorizontalAnchor

public function set HorizontalAnchor (value : FigureHorizontalAnchor)

<object HorizontalAnchor="FigureHorizontalAnchor" .../>

Property Value

A member of the FigureHorizontalAnchor enumeration specifying a horizontal anchor location for the Figure. The default value is ColumnRight.

The following example shows how to set the HorizontalAnchor attribute of a Figure element.

      Width="140" Height="50" 

The following example shows how to set the HorizontalAnchor property programmatically.

Figure figx = new Figure();
figx.Name = "myFigure";
figx.Width = new FigureLength(140);
figx.Height = new FigureLength(50);
figx.HorizontalAnchor = FigureHorizontalAnchor.PageCenter;
figx.VerticalAnchor = FigureVerticalAnchor.PageCenter;
figx.HorizontalOffset = 100;
figx.VerticalOffset = 20;
figx.WrapDirection = WrapDirection.Both;

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

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

© 2016 Microsoft