Forms2OleControlCaption Property

Gets Caption property of control. Default value is an empty string.

Namespace:  Aspose.Words.Drawing.Ole
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 21.11.0

ExpandedSyntax

public string Caption { get; }

Property Value

Type: String

ExpandedExamples

Shows how to verify the properties of an ActiveX control.
Document doc = new Document(MyDir + "ActiveX controls.docx");

Shape shape = (Shape) doc.GetChild(NodeType.Shape, 0, true);
OleControl oleControl = shape.OleFormat.OleControl;

Assert.AreEqual(null, oleControl.Name);

if (oleControl.IsForms2OleControl)
{
    Forms2OleControl checkBox = (Forms2OleControl) oleControl;
    Assert.AreEqual("Первый", checkBox.Caption);
    Assert.AreEqual("0", checkBox.Value);
    Assert.AreEqual(true, checkBox.Enabled);
    Assert.AreEqual(Forms2OleControlType.CheckBox, checkBox.Type);
    Assert.AreEqual(null, checkBox.ChildNodes);
}

ExpandedSee Also