Forms2OleControlCollection
Contents
[
Hide
]Forms2OleControlCollection class
Represents collection of Forms2OleControl
objects.
To learn more, visit the Working with Ole Objects documentation article.
public class Forms2OleControlCollection : IEnumerable<Forms2OleControl>
Constructors
Name | Description |
---|---|
Forms2OleControlCollection() | The default constructor. |
Properties
Name | Description |
---|---|
Count { get; } | Gets count of objects in the collection. |
Item { get; } | Gets Forms2OleControl object at a specified index. |
Methods
Name | Description |
---|---|
GetEnumerator() | Gets enumerator. |
Examples
Shows how to access an OLE control embedded in a document and its child controls.
Document doc = new Document(MyDir + "OLE ActiveX controls.docm");
// Shapes store and display OLE objects in the document's body.
Shape shape = (Shape)doc.GetChild(NodeType.Shape, 0, true);
Assert.AreEqual("6e182020-f460-11ce-9bcd-00aa00608e01", shape.OleFormat.Clsid.ToString());
Forms2OleControl oleControl = (Forms2OleControl)shape.OleFormat.OleControl;
// Some OLE controls may contain child controls, such as the one in this document with three options buttons.
Forms2OleControlCollection oleControlCollection = oleControl.ChildNodes;
Assert.AreEqual(3, oleControlCollection.Count);
Assert.AreEqual("C#", oleControlCollection[0].Caption);
Assert.AreEqual("1", oleControlCollection[0].Value);
Assert.AreEqual("Visual Basic", oleControlCollection[1].Caption);
Assert.AreEqual("0", oleControlCollection[1].Value);
Assert.AreEqual("Delphi", oleControlCollection[2].Caption);
Assert.AreEqual("0", oleControlCollection[2].Value);
See Also
- class Forms2OleControl
- namespace Aspose.Words.Drawing.Ole
- assembly Aspose.Words