Window.Close method (Boolean)
This documentation is preliminary and is subject to change.
Closes the window that is represented by the Window object and optionally forces an unsaved form or form with unsaved changes to be closed without saving.
Assembly: Microsoft.Office.InfoPath (in Microsoft.Office.InfoPath.dll)
'Declaration Public MustOverride Sub Close ( _ force As Boolean _ ) 'Usage Dim instance As Window Dim force As Boolean instance.Close(force)
Parameters
- force
- Type: System.Boolean
Specifies whether open unsaved documents will be saved. The default value is false.
| Exception | Condition |
|---|---|
| InvalidOperationException | The Close method was called from an event handler for the Loading event |
| ArgumentNullException | The parameter passed to this method is Nothing. |
| ArgumentException | The parameter passed to this method is not valid. For example, it is of the wrong type or format. |
The Close(force) method will close the associated window and the forms that it contains. If the force parameter is set to true, all forms will be closed without saving, even if they have not been saved, or contain changes since they were last saved. If set to false, users will be prompted to save their changes.
The Close method can be used only with the editing window types; if used with a designing window type, it will raise an exception. In addition, the Close method can only be used with the SubmitEventHandler and ClickedEventHandler event handlers. If used with any other type of event handler, it will raise an exception.
Note
|
|---|
If the window being closed is the only window open in Microsoft InfoPath, the InfoPath application will also be closed. |
This member can be accessed only by forms running in the same domain as the currently open form, or by forms that have been granted cross-domain permissions.
This type or member can be accessed only from code running in forms opened in Microsoft InfoPath Filler.
Note