1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
<html dir="ltr"><head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<META HTTP-EQUIV="assetid" CONTENT="HV01021189"><META NAME="lcid" CONTENT="1033"><title>Windows Collection</title><link rel="stylesheet" type="text/css" href="office10.css"><script type="text/javascript" language="Javascript" src="ExpCollapse.js"></script><script type="text/javascript" language="JavaScript" src="inline.js"></script></head><body><p id="ExpandAllLine" class="ExpFav"><a href="#" onclick="ExpandAll()" onkeypress="ExpandAll()" class="DropDown"><img id="picHeader" border="0" src="expandtri.gif" alt="Show All"><span id="ExpandAll">Show All</span></a></p><h1>Windows Collection</h1><div class="ofvbanav"><span class="ofvbanavreuse" id="seealso" onclick="toggleList()" onkeypress="toggleList()"></span><span class="ofvbanavreuse" id="properties" onclick="toggleList()" onkeypress="toggleList()"></span><span class="ofvbanavreuse" id="methods" onclick="toggleList()" onkeypress="toggleList()"></span><span class="ofvbanavreuse" id="events" onclick="toggleList()" onkeypress="toggleList()"></span><span class="ofvbanavreuse" id="specifics" onclick="toggleList()" onkeypress="toggleList()"></span></div><table class="ofvbaomart"><tr><td class="noborder" nowrap="true"><A HREF="xdcolWindows.htm" title="Windows"><SPAN class="omyellow" tabindex="0">Windows</SPAN></A><br /><IMG SRC="../img/space.gif" BORDER="0"></IMG><IMG SRC="../img/parchild.gif" BORDER="0"></IMG><A HREF="xdobjWindow.htm" title="Window"><SPAN class="omblue" tabindex="0">Window</SPAN></A><br /></td></tr></table><p>Contains a <b class="bterm"><a href="xdobjWindow.htm" id="HV01021252" lcid=" ">Window</a></b> object for each window within a Microsoft Office InfoPath 2003 form. <b class="bterm">Window</b> objects represent the two types of windows that are used in the InfoPath application: the editing window that is used as the <a href="#" class="glossary" onclick="AppendPopup(this,'xdformarea')" onkeypress="AppendPopup(this,'xdformarea')">form area</a> when a user fills out a form, and the designing window that is used as the <a href="#" class="glossary" onclick="AppendPopup(this,'xddesignmode')" onkeypress="AppendPopup(this,'xddesignmode')">design mode</a> when a user designs a form.</p><h2>Remarks</h2><p>The <b class="bterm">Windows</b> collection implements properties that can be used to access a form's associated <b class="bterm">Window</b> objects, and it is accessible through the <b class="bterm"><a href="xdproWindows.htm" id="HV01021357" lcid=" ">Windows</a></b> property of the <b class="bterm"><a href="xdobjApplication.htm" id="HV01021256" lcid=" ">Application</a></b> object.</p><p><b>Note</b> The <b class="bterm">Windows</b> collection can be used only to get the count of <b class="bterm">Window</b> objects that it contains or to return a reference to a specified <b class="bterm">Window</b> object. It cannot be used to create, add, or remove <b class="bterm">Window</b> objects.</p><h2>Using the Windows collection</h2><p>In the following example, implemented as an OnClick <a href="#" class="glossary" onclick="AppendPopup(this,'xdeventhandler')" onkeypress="AppendPopup(this,'xdeventhandler')">event handler</a> for a button on a form, the <b class="bterm">Windows</b> property of the <b class="bterm">Application</b> object is used to set a reference to the <b class="bterm">Windows</b> collection. The code then loops through the collection and displays the type of each <b class="bterm">Window</b> object that it contains.</p><pre><code>function ShowWindowTypes::OnClick(eventObj)
{
// Set a reference to the Windows collection.
var objWindows = Application.<b class="bterm">Windows</b>;
var strWindowType;
// Loop through the collection and display the type
// of each Window object that it contains.
for (i=0; i < objWindows.Count; i++)
{
switch (objWindows(i).Type)
{
case 0:
strWindowType = "Editing window";
break;
case 1:
strWindowType = "Designing window";
break;
}
XDocument.UI.Alert("Window type " + i + ": " + strWindowType);
}
objWindows = null;
strWindowType = null;
}
</code></pre><p>For more information about using the <b class="bterm">Windows</b> collection, see <a href="inconWorkingWithFormWindows.htm" id="HV01039909" lcid=" ">Working with form windows</a>.</p><script type="text/javascript" language="JScript" src="ofvbanl.js"></script><span id="ofVBAISpan" class="ofvbaispan"><iframe id="ofVBAIFrame" frameborder="0" marginheight="0" marginwidth="4" scrolling="auto" width="100%" src="../links/xdcolWindows_l.htm"></iframe></span><center><a href="XMLSchemaCopyright_HV01147162.htm">©2003-2004 Microsoft Corporation. All rights reserved.</a>
Permission to copy, display and distribute this document is available at: <a
href="http://r.office.microsoft.com/r/rlidAWSContentRedir?AssetID=XT010988631033&CTT=11&Origin=HV011232471033"
target="_new">http://msdn.microsoft.com/library/en-us/odcXMLRef/html/odcXMLRefLegalNotice.asp</a></center></body></html>
|