Aspose::Words::Drawing::HorizontalRuleFormat::get_Color method

HorizontalRuleFormat::get_Color method

Gets or sets the brush color that fills the horizontal rule.

System::Drawing::Color Aspose::Words::Drawing::HorizontalRuleFormat::get_Color()

Remarks

This is a shortcut to the Color property.

The default value is Gray.

Examples

Shows how to insert a horizontal rule shape, and customize its formatting.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
SharedPtr<Shape> shape = builder->InsertHorizontalRule();

SharedPtr<HorizontalRuleFormat> horizontalRuleFormat = shape->get_HorizontalRuleFormat();
horizontalRuleFormat->set_Alignment(HorizontalRuleAlignment::Center);
horizontalRuleFormat->set_WidthPercent(70);
horizontalRuleFormat->set_Height(3);
horizontalRuleFormat->set_Color(System::Drawing::Color::get_Blue());
horizontalRuleFormat->set_NoShade(true);

ASSERT_TRUE(shape->get_IsHorizontalRule());
ASSERT_TRUE(shape->get_HorizontalRuleFormat()->get_NoShade());

See Also