Figure.Width 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取或设置一个值,该值指示 Figure 元素的宽度。
public:
property System::Windows::FigureLength Width { System::Windows::FigureLength get(); void set(System::Windows::FigureLength value); };
public System.Windows.FigureLength Width { get; set; }
member this.Width : System.Windows.FigureLength with get, set
Public Property Width As FigureLength
属性值
一个 FigureLength 结构,它指定 Figure 的宽度特性。
默认值为 FigureLength。Value = 1.0 和 FigureLength.AutoFigureUnitType = .
示例
以下示例演示如何设置 Width 元素的 Figure 属性。
<FlowDocument>
<Paragraph>
<Figure
Name="myFigure"
Width="140" Height="50"
HorizontalAnchor="PageCenter"
VerticalAnchor="PageCenter"
HorizontalOffset="100"
VerticalOffset="20"
WrapDirection="Both"
/>
</Paragraph>
</FlowDocument>
下面的示例演示如何以编程方式设置 Width 属性。
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);
Dim figx As New Figure()
With figx
.Name = "myFigure"
.Width = New FigureLength(140)
.Height = New FigureLength(50)
.HorizontalAnchor = FigureHorizontalAnchor.PageCenter
.VerticalAnchor = FigureVerticalAnchor.PageCenter
.HorizontalOffset = 100
.VerticalOffset = 20
.WrapDirection = WrapDirection.Both
End With
Dim parx As New Paragraph(figx)
Dim flowDoc As New FlowDocument(parx)
注解
依赖项属性信息
标识符字段 | WidthProperty |
元数据属性设置为 true |
AffectsMeasure |