HorizontalRuleFormat

Shape.HorizontalRuleFormat property

提供对水平规则形状属性的访问。 对于不是水平规则的形状,返回 null。

public HorizontalRuleFormat HorizontalRuleFormat { get; }

例子

显示如何插入水平线形,并自定义其格式。

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
Shape shape = builder.InsertHorizontalRule();

HorizontalRuleFormat horizontalRuleFormat = shape.HorizontalRuleFormat;
horizontalRuleFormat.Alignment = HorizontalRuleAlignment.Center;
horizontalRuleFormat.WidthPercent = 70;
horizontalRuleFormat.Height = 3;
horizontalRuleFormat.Color = Color.Blue;
horizontalRuleFormat.NoShade = true;

Assert.True(shape.IsHorizontalRule);
Assert.True(shape.HorizontalRuleFormat.NoShade);

也可以看看