Forms2OleControlCollection Class |
Namespace: Aspose.Words.Drawing.Ole
The Forms2OleControlCollection type exposes the following members.
Name | Description | |
---|---|---|
![]() | Forms2OleControlCollection | Initializes a new instance of the Forms2OleControlCollection class |
Name | Description | |
---|---|---|
![]() ![]() | Count |
Gets count of objects in the collection.
|
![]() ![]() | Item |
Gets Forms2OleControl object at specified index.
|
Name | Description | |
---|---|---|
![]() | Equals | (Inherited from Object.) |
![]() | GetHashCode | (Inherited from Object.) |
![]() | GetType | (Inherited from Object.) |
![]() | ToString | (Inherited from Object.) |
// Open a document that contains a Microsoft Forms OLE control with child controls Document doc = new Document(MyDir + "OLE ActiveX controls.docm"); // Get the shape that contains the control 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 controls contain child controls Forms2OleControlCollection oleControlCollection = oleControl.ChildNodes; // In this case, the child controls are 3 option buttons 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);