# UI Object

UI

Represents various user interface components that can be used in a Microsoft Office InfoPath 2003 form. The UI (user interface) object provides a number of methods for displaying custom and built-in dialog boxes.

## Remarks

The UI object is used to programmatically display various types of dialog boxes to users as they fill out a form. It is not used for modifying the InfoPath user interface.

## Using the UI object

The UI object is accessed through the UI property of the XDocument object.

The UI object provides the Alert method, which is used to display a simple message box with some custom text, as shown in the following example:

    XDocument.UI.Alert("Custom message text goes here.");

One of the built-in InfoPath dialog boxes that the UI object can display is the Digital Signatures dialog box; this dialog box can be displayed to the user by using the ShowSignatureDialog method, as follows:

    XDocument.UI.ShowSignatureDialog();

Note The ShowSignatureDialog method can be used only in forms that have been enabled for digital signing. The method will return an error if used in a form that is not enabled for digital signing.

For more information about using the UI object, see Displaying alerts and dialog boxes.

©2003-2004 Microsoft Corporation. All rights reserved. Permission to copy, display and distribute this document is available at: http://msdn.microsoft.com/library/en-us/odcXMLRef/html/odcXMLRefLegalNotice.asp