Value
Innehåll
[
Dölj
]Forms2OleControl.Value property
Hämtar underliggande värdeegenskap som ofta representerar kontrolltillstånd. Till exempel har en markerad alternativknapp värdet ‘1’ medan en omarkerad har värdet ‘0’. Standardvärdet är en tom sträng.
public string Value { get; }
Exempel
Visar hur man verifierar egenskaperna för en ActiveX-kontroll.
Document doc = new Document(MyDir + "ActiveX controls.docx");
Shape shape = (Shape)doc.GetChild(NodeType.Shape, 0, true);
OleControl oleControl = shape.OleFormat.OleControl;
Assert.AreEqual("CheckBox1", oleControl.Name);
if (oleControl.IsForms2OleControl)
{
Forms2OleControl checkBox = (Forms2OleControl)oleControl;
Assert.AreEqual("First", checkBox.Caption);
Assert.AreEqual("0", checkBox.Value);
Assert.AreEqual(true, checkBox.Enabled);
Assert.AreEqual(Forms2OleControlType.CheckBox, checkBox.Type);
Assert.AreEqual(null, checkBox.ChildNodes);
Assert.AreEqual(string.Empty, checkBox.GroupName);
// Observera att du inte kan ange gruppnamn för en ram.
checkBox.GroupName = "Aspose group name";
}
Se även
- class Forms2OleControl
- namnutrymme Aspose.Words.Drawing.Ole
- hopsättning Aspose.Words