HorizontalRuleFormatNoShade Property

Indicates the presence of 3D shading for the horizontal rule. If true, then the horizontal rule is without 3D shading and solid color is used.

Namespace:  Aspose.Words.Drawing
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntax
public bool NoShade { get; set; }

Property Value

Type: Boolean
Remarks

The default value is false.

Examples
Shows how to insert horizontal rule shape in a document and customize the formatting.
// Use a document builder to insert a horizontal rule
DocumentBuilder builder = new DocumentBuilder();
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;

MemoryStream stream = new MemoryStream();
builder.Document.Save(stream, SaveFormat.Docx);

// Get the rule from the document's shape collection and verify it
Shape horizontalRule = (Shape)builder.Document.GetChild(NodeType.Shape, 0, true);
Assert.True(horizontalRule.IsHorizontalRule);
Assert.True(horizontalRule.HorizontalRuleFormat.NoShade);
Assert.AreEqual(HorizontalRuleAlignment.Center, horizontalRule.HorizontalRuleFormat.Alignment);
Assert.AreEqual(70, horizontalRule.HorizontalRuleFormat.WidthPercent);
Assert.AreEqual(3, horizontalRule.HorizontalRuleFormat.Height);
Assert.AreEqual(Color.Blue.ToArgb(), horizontalRule.HorizontalRuleFormat.Color.ToArgb());
See Also