Value
Inhalt
[
Ausblenden
]Forms2OleControl.Value property
Ruft die zugrunde liegende Werteigenschaft ab, die häufig den Steuerelementstatus darstellt. Beispielsweise hat ein aktiviertes Optionsfeld den Wert „1“, während ein deaktiviertes den Wert „0“ hat. Der Standardwert ist eine leere Zeichenfolge.
public string Value { get; }
Beispiele
Zeigt, wie die Eigenschaften eines ActiveX-Steuerelements überprüft werden.
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);
// Beachten Sie, dass Sie für einen Frame keinen Gruppennamen festlegen können.
checkBox.GroupName = "Aspose group name";
}
Siehe auch
- class Forms2OleControl
- namensraum Aspose.Words.Drawing.Ole
- Montage Aspose.Words