OleControl
Contents
[
Hide
]OleControl class
Represents OLE ActiveX control.
To learn more, visit the Working with Ole Objects documentation article.
public class OleControl
Properties
Name | Description |
---|---|
IsForms2OleControl { get; } | Returns true if the control is a Forms2OleControl . |
Name { get; set; } | Gets or sets name of the ActiveX control. |
Examples
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("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);
// Note, that you can't set GroupName for a Frame.
checkBox.GroupName = "Aspose group name";
}
See Also
- namespace Aspose.Words.Drawing.Ole
- assembly Aspose.Words