Microsoft KB Archive/827009

= How to resize the controls on a Microsoft Office InfoPath form based on the width of the form =

Article ID: 827009

Article Last Modified on 4/11/2007

-

APPLIES TO


 * Microsoft Office InfoPath 2007
 * Microsoft Office InfoPath 2003
 * Microsoft Office InfoPath 2003, Service Pack 1 (SP1)

-



IN THIS TASK

 * SUMMARY
 * Activate relative sizing for controls that are not tables
 * Activate relative sizing for tables



SUMMARY
This step-by-step article describes how to resize the controls on a Microsoft Office InfoPath form based on the width of the form.

back to the top

Activate relative sizing for controls that are not tables
The following steps describe how to activate relative sizing for controls that are not tables by using a Rich TextBox control. However, you can also use this procedure for other controls on your InfoPath form.
 * 1) Start InfoPath. Create a blank form.
 * 2) In the Controls task pane, add a Rich TextBox control to the form.
 * 3) Right-click the Rich TextBox control, and then click Rich TextBox Properties.
 * 4) Click the Size tab of the Rich TextBox Properties dialog box, and then set the Width property to 50.
 * 5) Change the units from px to %.
 * 6) Click OK to accept the changes.

When you resize the form, you also resize the width of the Rich TextBox control.

back to the top

Activate relative sizing for tables
You cannot resize tables based on the form in the InfoPath Designer (for table controls that repeat and for layout tables). To support relative sizing for a table on the form, you must manually modify the view. You can preserve your manual modifications by using the mode=&quot;xd:preserve&quot; attribute, as follows.

Note If you apply the mode=&quot;xd:preserve&quot; attribute to your table, you cannot make changes to your table in the InfoPath Designer.  Start InfoPath. Create a blank form. From the Layout task pane, add a Two-Column table to the form. Click anywhere inside the table. On the Table menu, point to Select, and then click Table. On the Table menu, click Borders and Shading. Under Presets, click Outline to add a border to the perimeter of the table. Click OK. Click Save to save the form. In InfoPath 2007, click Save as Source Files on the File menu, and then select a folder to save the files to.

In InfoPath 2003, click Extract Form Files on the File menu, and then select a folder to extract the files to.</li> Close InfoPath.</li> By using a text editor (such as Notepad), open the View1.xsl file from the list of extracted files.</li>  Locate the following table element in View1.xsl: </li> Press CTRL+X to remove this element. Put the element on the clipboard.</li> Put the pointer between the opening tag and the closing tag for the new template element, and then press CTRL+V to paste the table information from the clipboard in the new template element.</li></ol> </li> In the table and its child elements, locate the Width settings for the table and its two columns, and then change the Width settings to 50 percent.</li> Save the View1.xsl file. Close the View1.xsl file.</li> In the extracted files, right-click the Manifest.xsf file, and then click Design.

The form opens in InfoPath. In the Design view of the form, the table is replaced by a Preserve Code Block label that is outlined in red.</li> Click the Preview Form button to view the table.

When the form size changes, the width of the table adjusts to maintain a width that is 50% of the form width.</li></ol>

back to the top

Additional query words: IP2007

Keywords: kbpubtypekc kbhowto KB827009

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.