Windows Collection


Windows Collection

The Windows collection implements a set of properties that provide access to the Windows object associated with the current solution. The properties are shown in Table A.2.

Table A.2: Properties of The Windows Collection.

Name

Security Level

Description

Count Property

1

Returns a count of the total number of Window objects contained in the collection

Item Property

1

Returns a reference to the specified Window property

InfoPath provides two types of application windows. The first is the editing window, which you use when filling out a form. The second is the design window, which form developers use. Listing A.1 loops through the entire Windows collection and displays the window type.

Listing A.1: Looping Through The Windows Collection.
start example
 // Set the reference to the Windows collection.     var objWindows = Application.Windows;     var strWType;   // show the count of windows   XDocument.UI.Alert("There are " + objWindows.Count + " open for this  solution")     // Look through the collection     for (i=0; i < objWindows.Count; i++)     {       switch (objWindows(i).Type)   {       case 0:         strWType = "Editing window";         break;       case 1:         strWType = "Designer window";         break;   }   XDocument.UI.Alert("Window type " + i + ": " + strWType); } objWindows = null; strWType = null; 
end example
 
Note  

The Windows collection does not allow you to create, add, or remove specific Window objects.




Programming Microsoft Infopath. A Developers Guide
Programming Microsoft Infopath: A Developers Guide
ISBN: 1584504536
EAN: 2147483647
Year: 2006
Pages: 111
Authors: Thom Robbins

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net