# Form

Namespace: **Wisej.Web**

Assembly: **Wisej.Framework** (4.0.0.0)

* [Control](https://docs.wisej.com/api/wisej.web/general/control)
  * [ScrollableControl](https://docs.wisej.com/api/wisej.web/containers/scrollablecontrol)
    * [ContainerControl](https://docs.wisej.com/api/wisej.web/containers/containercontrol)
      * [Form](https://docs.wisej.com/api/wisej.web/containers/form)

Represents a window or dialog box that makes up an application's user interface.

{% tabs %}
{% tab title="C#" %}

```csharp
public class Form : ContainerControl, IWisejWindow
```

{% endtab %}

{% tab title="VB.NET" %}

```visual-basic
Public Class Form
    Inherits ContainerControl
    Implements IWisejWindow
```

{% endtab %}
{% endtabs %}

## Constructors

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Form()

Default constructor.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Form(onClosed)

Initializes a new instance of the [Form](https://docs.wisej.com/api/wisej.web/containers/form) class with the specified initial settings.

| Name         | Type                                                                                | Description                              |
| ------------ | ----------------------------------------------------------------------------------- | ---------------------------------------- |
| **onClosed** | [Action\<Object, EventArgs>](https://docs.microsoft.com/dotnet/api/system.action-2) | Handler for the [Closed](#closed) event. |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Form(controls, onClosed)

Initializes a new instance of the [Form](https://docs.wisej.com/api/wisej.web/containers/form) class with the specified initial settings.

| Name         | Type                                                                                | Description                                                                                                  |
| ------------ | ----------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| **controls** | [Control\[\]](https://docs.wisej.com/api/wisej.web/general/control)                 | An array of [Control](https://docs.wisej.com/api/wisej.web/general/control) objects to be added to the form. |
| **onClosed** | [Action\<Object, EventArgs>](https://docs.microsoft.com/dotnet/api/system.action-2) | Handler for the [Closed](#closed) event.                                                                     |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Form(location, size, controls)

Initializes a new instance of the [Form](https://docs.wisej.com/api/wisej.web/containers/form) class with the specified initial settings.

| Name         | Type                                                                | Description                                                                                                  |
| ------------ | ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| **location** | [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point) | The location of the form on the screen.                                                                      |
| **size**     | [Size](https://docs.microsoft.com/dotnet/api/system.drawing.size)   | The size of the form.                                                                                        |
| **controls** | [Control\[\]](https://docs.wisej.com/api/wisej.web/general/control) | An array of [Control](https://docs.wisej.com/api/wisej.web/general/control) objects to be added to the form. |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Form(location, size, onClosed)

Initializes a new instance of the [Form](https://docs.wisej.com/api/wisej.web/containers/form) class with the specified initial settings.

| Name         | Type                                                                                | Description                              |
| ------------ | ----------------------------------------------------------------------------------- | ---------------------------------------- |
| **location** | [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point)                 | The location of the form on the screen.  |
| **size**     | [Size](https://docs.microsoft.com/dotnet/api/system.drawing.size)                   | The size of the form.                    |
| **onClosed** | [Action\<Object, EventArgs>](https://docs.microsoft.com/dotnet/api/system.action-2) | Handler for the [Closed](#closed) event. |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Form(location, size, controls, onClosed)

Initializes a new instance of the [Form](https://docs.wisej.com/api/wisej.web/containers/form) class with the specified initial settings.

| Name         | Type                                                                                | Description                                                                                                  |
| ------------ | ----------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| **location** | [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point)                 | The location of the form on the screen.                                                                      |
| **size**     | [Size](https://docs.microsoft.com/dotnet/api/system.drawing.size)                   | The size of the form.                                                                                        |
| **controls** | [Control\[\]](https://docs.wisej.com/api/wisej.web/general/control)                 | An array of [Control](https://docs.wisej.com/api/wisej.web/general/control) objects to be added to the form. |
| **onClosed** | [Action\<Object, EventArgs>](https://docs.microsoft.com/dotnet/api/system.action-2) | Handler for the [Closed](#closed) event.                                                                     |

## Properties

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) AcceptButton

[IButtonControl](https://docs.wisej.com/api/wisej.web/interfaces/wisej.web.ibuttoncontrol): Returns or sets the button on the form that is clicked when the user presses the ENTER key. (Default: `null`)

Assigning the AcceptButton doesn't automatically close the window when the button is pressed. It only assigns the value of the [DialogResult](#dialogresult) property of the form to the value of the [DialogResult](https://docs.wisej.com/api/interfaces/wisej.web.ibuttoncontrol#dialogresult) property of the button.\
To close the form when the [AcceptButton](#acceptbutton) is clicked, you have to call the [Close](#close) method when the button is pushed.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Active

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns whether the form is the currently active top level window or the active mdi child window.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-e4f8ed47a52590951f725a10c269555e81d41d81%2Fstatic.png?alt=media) ActiveForm

[Form](https://docs.wisej.com/api/wisej.web/containers/form): Returns the currently active form for this application.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) ActiveMdiChild

[Form](https://docs.wisej.com/api/wisej.web/containers/form): Returns the currently active multiple-document interface (MDI) child window.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) AllowTransparency

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets whether the opacity of the form can be adjusted. (Default: `True`)

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) AppearanceKey

[String](https://docs.microsoft.com/dotnet/api/system.string): Sets the appearance key for the theme engine. (Default: `null`)

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) AutoClose

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Automatically closes the form or dialog when the user clicks anywhere on the browser outside of the form. (Default: `False`)

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) AutoCloseModalDialog

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): EXPERIMENTAL: Automatically closes the [Modal](#modal) dialog when [DialogResult](#dialogresult) is assigned to a value different than [None](https://docs.wisej.com/api/enumerations/wisej.web.dialogresult#fields) by code or by a user action, i.e.: [AcceptButton](#acceptbutton) click.<mark style="color:blue;background-color:green;">Since 3.5.6</mark> (Default: `False`)

You can change the default value across the application using the [AutoCloseModalDialogDefault](#autoclosemodaldialogdefault) property or related [AppContext](https://docs.microsoft.com/dotnet/api/system.appcontext) switch. The default WinForms behavior is to automatically close the modal dialog.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-e4f8ed47a52590951f725a10c269555e81d41d81%2Fstatic.png?alt=media) AutoCloseModalDialogDefault

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): EXPERIMENTAL: Default value for the [AutoCloseModalDialog](#autoclosemodaldialog) property.<mark style="color:blue;background-color:green;">Since 3.5.6</mark> (Default: `False`)

The default is false. You can set the value by code or using [AppContext](https://docs.microsoft.com/dotnet/api/system.appcontext) switches: `AppContext.SetSwitch("FormAutoCloseModalDialog", true);`

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) AutoSize

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets a value that indicates whether the control resizes based on its contents. (Default: `False`)

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) AutoSizeMode

[AutoSizeMode](https://docs.wisej.com/api/wisej.web/enumerations/wisej.web.autosizemode): Indicates the automatic sizing behavior of the control. (Default: `GrowOnly`)

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) AutoValidate

[AutoValidate](https://docs.wisej.com/api/wisej.web/enumerations/wisej.web.autovalidate): Returns or sets how the control performs validation when the user changes focus to another control. (Default: `EnablePreventFocusChange`)

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) CancelButton

[IButtonControl](https://docs.wisej.com/api/wisej.web/interfaces/wisej.web.ibuttoncontrol): Returns or sets the button control that is clicked when the user presses the ESC key. (Default: `null`)

Assigning the CancelButton doesn't automatically close the window when the button is pressed. It only assigns the value of the [DialogResult](#dialogresult) property of the form to the value of the [DialogResult](https://docs.wisej.com/api/interfaces/wisej.web.ibuttoncontrol#dialogresult) property of the button.\
To close the form when the [CancelButton](#cancelbutton) is clicked, you have to call the [Close](#close) method when the button is pushed.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) ClientArea

[Rectangle](https://docs.microsoft.com/dotnet/api/system.drawing.rectangle): Returns the client rectangle to use in the designer.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) ClientSize

[Size](https://docs.microsoft.com/dotnet/api/system.drawing.size): Returns or sets the size of the client area of the form.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) CloseBox

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets whether the Close button is displayed in the caption bar of the form. (Default: `True`)

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) CloseReason

[CloseReason](https://docs.wisej.com/api/wisej.web/containers/form/wisej.web.closereason): Returns the reason for the form closing. (Default: `None`)

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) ControlBox

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets whether a control box is displayed in the caption bar of the form. (Default: `True`)

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) DialogResult

[DialogResult](https://docs.wisej.com/api/wisej.web/enumerations/wisej.web.dialogresult): Returns or sets the dialog result for the form. (Default: `None`)

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) DisableMergedMenu

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Enables or disables merging the MdiParent's menu with the active MdiChild form's menu. (Default: `False`)

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) FormBorderStyle

[FormBorderStyle](https://docs.wisej.com/api/wisej.web/containers/form/wisej.web.formborderstyle): Returns or sets the border style of the form. (Default: `Sizable`)

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) HasMdiChildren

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns whether this form is an [IsMdiContainer](#ismdicontainer) and has any Mdi child form. (Default: `False`)

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) HasOwnedForms

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns whether this form has any owned form. (Default: `False`)

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) HeaderBackColor

[Color](https://docs.microsoft.com/dotnet/api/system.drawing.color): Returns or sets the background color of the title bar and frame of the window.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) HeaderForeColor

[Color](https://docs.microsoft.com/dotnet/api/system.drawing.color): Returns or sets the text color of the title bar of the window.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Icon

[Image](https://docs.microsoft.com/dotnet/api/system.drawing.image): Returns or sets the icon (32x32) for the [Form](https://docs.wisej.com/api/wisej.web/containers/form).

The default value is null.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) IconLarge

[Image](https://docs.microsoft.com/dotnet/api/system.drawing.image): Returns or sets the large icon (128x128) for the [Form](https://docs.wisej.com/api/wisej.web/containers/form).

The deafult value is null.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) IconLargeSource

[String](https://docs.microsoft.com/dotnet/api/system.string): Returns or sets the theme name or URL for the large icon to display for the [Form](https://docs.wisej.com/api/wisej.web/containers/form).

The deafult value is null.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) IconSource

[String](https://docs.microsoft.com/dotnet/api/system.string): Returns or sets the theme name or URL for the icon to display for the [Form](https://docs.wisej.com/api/wisej.web/containers/form).

The default value is null.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) IsClosed

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns whether the [Form](https://docs.wisej.com/api/wisej.web/containers/form) has been closed. (Default: `False`)

Modal dialogs are reusable and are not disposed automatically when closed. Use this property to check whether a modal dialog has been closed, and use [IsDisposed](https://docs.wisej.com/api/general/control#isdisposed) to check if it has been disposed.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) IsDialog

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns whether the [Form](https://docs.wisej.com/api/wisej.web/containers/form) was created as a modal or modeless dialog using [ShowDialog](#showdialog-onclose). (Default: `False`)

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) IsMdiChild

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns a value indicating whether the form is a multiple-document interface (MDI) child form. (Default: `False`)

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) IsMdiContainer

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets whether the form is a container for multiple-document interface (MDI) child forms. (Default: `False`)

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) KeepCentered

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Keeps the form always centered in the browser. (Default: `False`)

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) KeepOnScreen

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Keeps the entire form within the browser view preventing the user from dragging the form, even partially, outside of the view. (Default: `False`)

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) LiveResize

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets whether the form is resized while the border is being dragged. (Default: `False`)

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) MaximizeBox

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets whether the Maximize button is displayed in the caption bar of the form. (Default: `True`)

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) MaximumSize

[Size](https://docs.microsoft.com/dotnet/api/system.drawing.size): Returns the maximum size the form can be resized to. (Default: `{Width=0, Height=0}`)

**Throws:**

* [ArgumentOutOfRangeException](https://docs.microsoft.com/dotnet/api/system.argumentoutofrangeexception)\
  The values of the height or width within the [Size](#size) object are less than zero.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) MdiChildren

[Form\[\]](https://docs.wisej.com/api/wisej.web/containers/form): Returns an array of forms that represent the multiple-document interface (MDI) child forms that are parented to this form.

Default value is Form\[0] (an empty array of Forms)

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) MdiClient

[MdiClient](https://docs.wisej.com/api/wisej.web/containers/form/wisej.web.mdiclient): Returns the internal MdiClient component. (Default: `null`)

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) MdiParent

[Form](https://docs.wisej.com/api/wisej.web/containers/form): Returns or sets the current multiple-document interface (MDI) parent form of this form. (Default: `null`)

**Throws:**

* [Exception](https://docs.microsoft.com/dotnet/api/system.exception)\
  The [Form](https://docs.wisej.com/api/wisej.web/containers/form) assigned to this property is not marked as an MDI container.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) MdiTabProperties

[MdiTabProperties](https://docs.wisej.com/api/wisej.web/containers/form/wisej.web.mditabproperties): Provides properties for the [TabControl](https://docs.wisej.com/api/wisej.web/containers/tabcontrol) object used to display the tabbed MDI interface.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Menu

[MainMenu](https://docs.wisej.com/api/wisej.web/menus/wisej.web.mainmenu): Returns or sets the [MainMenu](https://docs.wisej.com/api/wisej.web/menus/wisej.web.mainmenu) that is displayed in the form. (Default: `null`)

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) MergedMenu

[MainMenu](https://docs.wisej.com/api/wisej.web/menus/wisej.web.mainmenu): Returns the merged menu for the form. (Default: `null`)

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) MinimizeBox

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets whether the Minimize button is displayed in the caption bar of the form. (Default: `True`)

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) MinimumSize

[Size](https://docs.microsoft.com/dotnet/api/system.drawing.size): Returns or sets the minimum size the form can be resized to.

Default value is a Size with Width = 0, Height = 0**Throws:**

* [ArgumentOutOfRangeException](https://docs.microsoft.com/dotnet/api/system.argumentoutofrangeexception)\
  The values of the height or width within the [Size](#size) object are less than zero.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Modal

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns whether this form is displayed modally. (Default: `False`)

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Movable

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets whether the form can be moved by dragging. (Default: `True`)

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Opacity

[Double](https://docs.microsoft.com/dotnet/api/system.double): Returns or sets the opacity level of the form. (Default: `1`)

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) OwnedForms

[Form\[\]](https://docs.wisej.com/api/wisej.web/containers/form): Returns an array of [Form](https://docs.wisej.com/api/wisej.web/containers/form) objects that represent all forms that are owned by this form.

Default value is Form\[0] (an empty array of Forms)

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Owner

[Form](https://docs.wisej.com/api/wisej.web/containers/form): Returns or sets the form that owns this form. (Default: `null`)

**Throws:**

* [Exception](https://docs.microsoft.com/dotnet/api/system.exception)\
  A top-level window cannot have an owner.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) ShowInTaskbar

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets whether the form is displayed in the [Desktop](https://docs.wisej.com/api/wisej.web/containers/desktop) taskbar. (Default: `True`)

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) ShowModalMask

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets a value that shows the modal mask on the client when this form is displayed. (Default: `False`)

Modal forms - forms opened using [ShowDialog](#showdialog-onclose) - always show the modal mask by default.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Size

[Size](https://docs.microsoft.com/dotnet/api/system.drawing.size): Returns or sets the size of the form.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) StartPosition

[FormStartPosition](https://docs.wisej.com/api/wisej.web/containers/form/wisej.web.formstartposition): Returns or sets the starting position of the form at run time. (Default: `DefaultLocation`)

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Text

[String](https://docs.microsoft.com/dotnet/api/system.string): Returns or sets the title of the [Form](https://docs.wisej.com/api/wisej.web/containers/form) window. (Default: `""`)

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Tools

[ComponentToolCollection](https://docs.wisej.com/api/wisej.web/editors/wisej.web.componenttoolcollection): Returns the instance of [ComponentToolCollection](https://docs.wisej.com/api/wisej.web/editors/wisej.web.componenttoolcollection) associated with this control.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) TopLevel

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets whether to display the form as a top-level window. (Default: `True`)

**Throws:**

* [Exception](https://docs.microsoft.com/dotnet/api/system.exception)\
  A Multiple-document interface (MDI) parent form must be a top-level window.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) TopMost

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets whether the form should be displayed as a topmost form. (Default: `False`)

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) WindowState

[FormWindowState](https://docs.wisej.com/api/wisej.web/containers/form/wisej.web.formwindowstate): Returns or sets a value that indicates whether form is minimized, maximized, or normal. (Default: `Normal`)

## Methods

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Activate()

Activates the form and gives it focus.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) AddOwnedForm(ownedForm)

Adds an owned form to this form.

| Parameter     | Type                                                         | Description                                                                               |
| ------------- | ------------------------------------------------------------ | ----------------------------------------------------------------------------------------- |
| **ownedForm** | [Form](https://docs.wisej.com/api/wisej.web/containers/form) | The [Form](https://docs.wisej.com/api/wisej.web/containers/form) that this form will own. |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-9bf7fa01e02f4da0f9ef90d3b049ae43e664919e%2Fprotected.png?alt=media) CenterToScreen()

Centers the window on the current browser size.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Close()

Closes the form.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-9bf7fa01e02f4da0f9ef90d3b049ae43e664919e%2Fprotected.png?alt=media) Dispose(disposing)

Deactivate and remove the disposed window from the open form collections.

| Parameter     | Type                                                            | Description                                                                 |
| ------------- | --------------------------------------------------------------- | --------------------------------------------------------------------------- |
| **disposing** | [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) | true when this method is called by the application rather than a finalizer. |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-9bf7fa01e02f4da0f9ef90d3b049ae43e664919e%2Fprotected.png?alt=media) OnActivated(e)

Fires the [Activated](#activated) event.

| Parameter | Type                                                                | Description                                                                                         |
| --------- | ------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| **e**     | [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) | A [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) that contains the event data. |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-9bf7fa01e02f4da0f9ef90d3b049ae43e664919e%2Fprotected.png?alt=media) OnAddReferences(items)

Adds references components to the list. Referenced components can be added individually or as a reference to a collection.

| Parameter | Type                                                                    | Description                                             |
| --------- | ----------------------------------------------------------------------- | ------------------------------------------------------- |
| **items** | [IList](https://docs.microsoft.com/dotnet/api/system.collections.ilist) | Container for the referenced components or collections. |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-9bf7fa01e02f4da0f9ef90d3b049ae43e664919e%2Fprotected.png?alt=media) OnBindingContextChanged(e)

Fires the [BindingContextChanged](https://docs.wisej.com/api/general/control#bindingcontextchanged) event.

| Parameter | Type                                                                | Description                                                                                          |
| --------- | ------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| **e**     | [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) | An [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) that contains the event data. |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-9bf7fa01e02f4da0f9ef90d3b049ae43e664919e%2Fprotected.png?alt=media) OnClosed(e)

Fires the [Closed](#closed) event.

| Parameter | Type                                                                | Description                                                                                           |
| --------- | ------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| **e**     | [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) | The [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) that contains the event data. |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-9bf7fa01e02f4da0f9ef90d3b049ae43e664919e%2Fprotected.png?alt=media) OnClosing(e)

Fires the [Closing](#closing) event.

| Parameter | Type                                                                                           | Description                                                                                                                    |
| --------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| **e**     | [CancelEventArgs](https://docs.microsoft.com/dotnet/api/system.componentmodel.canceleventargs) | A [CancelEventArgs](https://docs.microsoft.com/dotnet/api/system.componentmodel.canceleventargs) that contains the event data. |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-9bf7fa01e02f4da0f9ef90d3b049ae43e664919e%2Fprotected.png?alt=media) OnControlAdded(e)

Fires the [ControlAdded](https://docs.wisej.com/api/general/control#controladded) event.

| Parameter | Type                                                                                                | Description                                                                                                                         |
| --------- | --------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| **e**     | [ControlEventArgs](https://docs.wisej.com/api/wisej.web/general/control/wisej.web.controleventargs) | A [ControlEventArgs](https://docs.wisej.com/api/wisej.web/general/control/wisej.web.controleventargs) that contains the event data. |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-9bf7fa01e02f4da0f9ef90d3b049ae43e664919e%2Fprotected.png?alt=media) OnCreateControl()

Raised when the control is created.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-9bf7fa01e02f4da0f9ef90d3b049ae43e664919e%2Fprotected.png?alt=media) OnDeactivate(e)

Fires the [Deactivate](#deactivate) event.

| Parameter | Type                                                                | Description                                                                                           |
| --------- | ------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| **e**     | [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) | The [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) that contains the event data. |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-9bf7fa01e02f4da0f9ef90d3b049ae43e664919e%2Fprotected.png?alt=media) OnEnabledChanged(e)

| Parameter | Type                                                                | Description                                                                                         |
| --------- | ------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| **e**     | [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) | A [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) that contains the event data. |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-9bf7fa01e02f4da0f9ef90d3b049ae43e664919e%2Fprotected.png?alt=media) OnFormClosed(e)

Raises the [FormClosed](#formclosed) event.

| Parameter | Type                                                                                                      | Description                                                                                                                               |
| --------- | --------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| **e**     | [FormClosedEventArgs](https://docs.wisej.com/api/wisej.web/containers/form/wisej.web.formclosedeventargs) | A [FormClosedEventArgs](https://docs.wisej.com/api/wisej.web/containers/form/wisej.web.formclosedeventargs) that contains the event data. |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-9bf7fa01e02f4da0f9ef90d3b049ae43e664919e%2Fprotected.png?alt=media) OnFormClosing(e)

Raises the [FormClosing](#formclosing) event.

| Parameter | Type                                                                                                        | Description                                                                                                                                 |
| --------- | ----------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| **e**     | [FormClosingEventArgs](https://docs.wisej.com/api/wisej.web/containers/form/wisej.web.formclosingeventargs) | A [FormClosingEventArgs](https://docs.wisej.com/api/wisej.web/containers/form/wisej.web.formclosingeventargs) that contains the event data. |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-9bf7fa01e02f4da0f9ef90d3b049ae43e664919e%2Fprotected.png?alt=media) OnHelpButtonClicked(e)

Fires the [HelpButtonClicked](#helpbuttonclicked) event.

| Parameter | Type                                                                | Description                                                                                         |
| --------- | ------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| **e**     | [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) | A [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) that contains the event data. |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-9bf7fa01e02f4da0f9ef90d3b049ae43e664919e%2Fprotected.png?alt=media) OnLayout(e)

Fires the [Layout](https://github.com/iceteagroup/wisej-docs-api/blob/v4.0/api?q=wisej.web.layout) event.

| Parameter | Type                                                                                              | Description                                                                                                                       |
| --------- | ------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| **e**     | [LayoutEventArgs](https://docs.wisej.com/api/wisej.web/general/control/wisej.web.layouteventargs) | A [LayoutEventArgs](https://docs.wisej.com/api/wisej.web/general/control/wisej.web.layouteventargs) that contains the event data. |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-9bf7fa01e02f4da0f9ef90d3b049ae43e664919e%2Fprotected.png?alt=media) OnLoad(e)

Fires the [Load](#load) event.

| Parameter | Type                                                                | Description                                                                                         |
| --------- | ------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| **e**     | [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) | A [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) that contains the event data. |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-9bf7fa01e02f4da0f9ef90d3b049ae43e664919e%2Fprotected.png?alt=media) OnLocationChanged(e)

Fires the [LocationChanged](https://docs.wisej.com/api/general/control#locationchanged) event.

| Parameter | Type                                                                | Description |
| --------- | ------------------------------------------------------------------- | ----------- |
| **e**     | [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) |             |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-9bf7fa01e02f4da0f9ef90d3b049ae43e664919e%2Fprotected.png?alt=media) OnMaximumSizeChanged(e)

Fires the [MaximumSizeChanged](#maximumsizechanged) event.

| Parameter | Type                                                                | Description                                                                                           |
| --------- | ------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| **e**     | [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) | The [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) that contains the event data. |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-9bf7fa01e02f4da0f9ef90d3b049ae43e664919e%2Fprotected.png?alt=media) OnMdiChildActivate(e)

Fires the [MdiChildActivate](#mdichildactivate) event.

| Parameter | Type                                                                | Description                                                                                           |
| --------- | ------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| **e**     | [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) | The [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) that contains the event data. |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-9bf7fa01e02f4da0f9ef90d3b049ae43e664919e%2Fprotected.png?alt=media) OnMdiChildAdded(e)

Fires the [MdiChildAdded](#mdichildadded) event.

| Parameter | Type                                                                                                | Description                                                                                           |
| --------- | --------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| **e**     | [ControlEventArgs](https://docs.wisej.com/api/wisej.web/general/control/wisej.web.controleventargs) | The [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) that contains the event data. |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-9bf7fa01e02f4da0f9ef90d3b049ae43e664919e%2Fprotected.png?alt=media) OnMdiChildRemoved(e)

Fires the [MdiChildRemoved](#mdichildremoved) event.

| Parameter | Type                                                                                                | Description                                                                                           |
| --------- | --------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| **e**     | [ControlEventArgs](https://docs.wisej.com/api/wisej.web/general/control/wisej.web.controleventargs) | The [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) that contains the event data. |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-9bf7fa01e02f4da0f9ef90d3b049ae43e664919e%2Fprotected.png?alt=media) OnMinimumSizeChanged(e)

Fires the [MinimumSizeChanged](#minimumsizechanged) event.

| Parameter | Type                                                                | Description                                                                                         |
| --------- | ------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| **e**     | [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) | A [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) that contains the event data. |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-9bf7fa01e02f4da0f9ef90d3b049ae43e664919e%2Fprotected.png?alt=media) OnMouseClick(e)

Fires the [MouseClick](https://docs.wisej.com/api/general/control#mouseclick) event.

| Parameter | Type                                                                                            | Description                                                                                                                     |
| --------- | ----------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| **e**     | [MouseEventArgs](https://docs.wisej.com/api/wisej.web/general/control/wisej.web.mouseeventargs) | A [MouseEventArgs](https://docs.wisej.com/api/wisej.web/general/control/wisej.web.mouseeventargs) that contains the event data. |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-9bf7fa01e02f4da0f9ef90d3b049ae43e664919e%2Fprotected.png?alt=media) OnShown(e)

Fires the [Shown](#shown) event.

| Parameter | Type                                                                | Description                                                                                         |
| --------- | ------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| **e**     | [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) | A [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) that contains the event data. |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-9bf7fa01e02f4da0f9ef90d3b049ae43e664919e%2Fprotected.png?alt=media) OnToolClick(e)

Fires the ToolClick event.

| Parameter | Type                                                                                            | Description                                                                                                                     |
| --------- | ----------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| **e**     | [ToolClickEventArgs](https://docs.wisej.com/api/wisej.web/editors/wisej.web.toolclickeventargs) | A [ToolClickEventArgs](https://docs.wisej.com/api/wisej.web/editors/wisej.web.toolclickeventargs) that contains the event data. |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-9bf7fa01e02f4da0f9ef90d3b049ae43e664919e%2Fprotected.png?alt=media) OnWebEvent(e)

Processes the event from the client.

| Parameter | Type                                                                           | Description      |
| --------- | ------------------------------------------------------------------------------ | ---------------- |
| **e**     | [WisejEventArgs](https://docs.wisej.com/api/wisej.core/general/wisejeventargs) | Event arguments. |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-9bf7fa01e02f4da0f9ef90d3b049ae43e664919e%2Fprotected.png?alt=media) OnWebRender(config)

Renders the client component.

| Parameter  | Type                                                          | Description                   |
| ---------- | ------------------------------------------------------------- | ----------------------------- |
| **config** | [Object](https://docs.microsoft.com/dotnet/api/system.object) | Dynamic configuration object. |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-9bf7fa01e02f4da0f9ef90d3b049ae43e664919e%2Fprotected.png?alt=media) OnWebUpdate(state)

Updates the client component using the state information.

| Parameter | Type                                                          | Description           |
| --------- | ------------------------------------------------------------- | --------------------- |
| **state** | [Object](https://docs.microsoft.com/dotnet/api/system.object) | Dynamic state object. |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-9bf7fa01e02f4da0f9ef90d3b049ae43e664919e%2Fprotected.png?alt=media) OnWindowStateChanged(e)

Fires the [WindowStateChanged](#windowstatechanged) event.

| Parameter | Type                                                                | Description                                                                                         |
| --------- | ------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| **e**     | [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) | A [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) that contains the event data. |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) PointToClient(point)

Computes the location of the specified screen point into client coordinates.

| Parameter | Type                                                                | Description                                                                                           |
| --------- | ------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| **point** | [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point) | The screen coordinate [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point) to convert. |

**Returns:** [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point). A [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point) that represents the converted [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point), *point* , in client coordinates.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) PointToScreen(point)

Computes the location of the specified client point into screen coordinates.

| Parameter | Type                                                                | Description                                                                                           |
| --------- | ------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| **point** | [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point) | The client coordinate [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point) to convert. |

**Returns:** [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point). A [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point) that represents the converted [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point), *point* , in screen coordinates.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Refresh(refreshChildren)

Forces the control to update the corresponding client widget. When in DesignMode it forces a full redraw of the designer surface for this control and optionally of its children, including the non-client areas such as the caption of forms or panels.

| Parameter           | Type                                                            | Description                                            |
| ------------------- | --------------------------------------------------------------- | ------------------------------------------------------ |
| **refreshChildren** | [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) | True to also refresh all the children of this control. |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) RemoveOwnedForm(ownedForm)

Removes an owned form from this form.

| Parameter     | Type                                                         | Description                                                                                                                                |
| ------------- | ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ |
| **ownedForm** | [Form](https://docs.wisej.com/api/wisej.web/containers/form) | A [Form](https://docs.wisej.com/api/wisej.web/containers/form) representing the form to remove from the list of owned forms for this form. |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Show(onclose)

Shows the form to the user.

| Parameter                                                                                                                                                                                                                 | Type                                                                                 | Description                                                                                                                                        |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| **onclose** ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-723b640963c6cd781ff8c5ce5b24149fa0af7b9c%2Fbadge-optional.svg?alt=media) | [Action\<Form, DialogResult>](https://docs.microsoft.com/dotnet/api/system.action-2) | Optional async handler for the close event; called when the form/dialog has been closed. It's the equivalent of handling the [event.](#formclosed) |

Forms are disposed immediately when they are closed and cannot be shown again.\
The optional *onclose* parameter is an asynchronous callback handler invoked when the form is closed. It is similar to handling the [FormClosed](#formclosed) event.

```csharp

form.Show((sender, result) => {
  
  // this code is executed when the form is closed.
  // sender is a reference to the form being closed.
  // result contains the value of form.DialogResult.
});

```

**Throws:**

* [InvalidOperationException](https://docs.microsoft.com/dotnet/api/system.invalidoperationexception)\
  The form being shown is already visible; or the form being shown is not a top-level window; or the form being shown as a dialog box is already a modal form.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Show(owner, onclose)

Shows the form with the specified owner to the user.

| Parameter                                                                                                                                                                                                                 | Type                                                                                 | Description                                                                                                                                                                          |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **owner**                                                                                                                                                                                                                 | [Form](https://docs.wisej.com/api/wisej.web/containers/form)                         | A [Form](https://docs.wisej.com/api/wisej.web/containers/form) that is related to this instance. This form is added to the [OwnedForms](#ownedforms) collection of the *owner* form. |
| **onclose** ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-723b640963c6cd781ff8c5ce5b24149fa0af7b9c%2Fbadge-optional.svg?alt=media) | [Action\<Form, DialogResult>](https://docs.microsoft.com/dotnet/api/system.action-2) | Optional async handler for the close event; called when the form/dialog has been closed. It's the equivalent of handling the [event.](#formclosed)                                   |

Forms are disposed immediately when they are closed and cannot be shown again.\
The optional *onclose* parameter is an asynchronous callback handler invoked when the form is closed. It is similar to handling the [FormClosed](#formclosed) event.

```csharp

form.Show((sender, result) => {
  
  // this code is executed when the form is closed.
  // sender is a reference to the form being closed.
  // result contains the value of form.DialogResult.
});

```

**Throws:**

* [InvalidOperationException](https://docs.microsoft.com/dotnet/api/system.invalidoperationexception)\
  The form being shown is already visible; or The form specified in the *owner* parameter is the same as the form being shown; or the form being shown is disabled; or the form being shown is not a top-level window; or the form being shown as a dialog box is already a modal form.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) ShowDialog(onclose)

Shows the form as a modal dialog box. When the *onclose* is specified, the dialog is modal only in the browser.

| Parameter                                                                                                                                                                                                                 | Type                                                                                 | Description                                                                                                                                        |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| **onclose** ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-723b640963c6cd781ff8c5ce5b24149fa0af7b9c%2Fbadge-optional.svg?alt=media) | [Action\<Form, DialogResult>](https://docs.microsoft.com/dotnet/api/system.action-2) | Optional async handler for the close event; called when the form/dialog has been closed. It's the equivalent of handling the [event.](#formclosed) |

**Returns:** [DialogResult](https://docs.wisej.com/api/wisej.web/enumerations/wisej.web.dialogresult). One of the [DialogResult](https://docs.wisej.com/api/wisej.web/enumerations/wisej.web.dialogresult) values.

When using ShowDialog, the dialog instance is not automatically disposed when the dialog is closed because dialogs are reusable. To make sure that memory is released properly, you must dispose the instance in your code or use the typical using pattern.\
Dialogs that are closed, but not disposed and not referenced by the application will be disposed by the Garbage Collector when it kicks in.

```csharp

using (var dialog and new MyDialog())
{
  dialog.ShowDialog();
}

```

Modal dialogs suspend the code execution on the server side effectively replicating the full modal workflow employed by desktop applications. However, when the optional *onclose* parameter is specified, the dialog is modal only in the browser and doesn't suspend the server thread. Which is similar to the typical asynchronous modal pattern used in javascript.

```csharp

dialog.ShowDialog((sender, result) => {
  
  // this code is executed when the dialog is closed.
  // sender is a reference to the dialog being closed.
  // result contains the value of dialog.DialogResult.
  
  // you may dispose it here:
  sender.Dispose();
});

// this code is executed immediately, unlike the real modal workflow.

```

**Throws:**

* [InvalidOperationException](https://docs.microsoft.com/dotnet/api/system.invalidoperationexception)\
  The form being shown is already visible; or the form being shown is disabled; or the form being shown is not a top-level window; or the form being shown as a dialog box is already a modal form.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) ShowDialog(owner, onclose)

Shows the form as a modal dialog box with the specified owner. When the *onclose* is specified, the dialog is modal only in the browser.

| Parameter                                                                                                                                                                                                                 | Type                                                                                 | Description                                                                                                                                                                                                                                                                                                          |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **owner**                                                                                                                                                                                                                 | [Form](https://docs.wisej.com/api/wisej.web/containers/form)                         | A [Form](https://docs.wisej.com/api/wisej.web/containers/form) that is related to this instance. This form is added to the [OwnedForms](#ownedforms) collection of the *owner* form.                                                                                                                                 |
| **onclose** ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-723b640963c6cd781ff8c5ce5b24149fa0af7b9c%2Fbadge-optional.svg?alt=media) | [Action\<Form, DialogResult>](https://docs.microsoft.com/dotnet/api/system.action-2) | Optional async handler for the close event; called when the form/dialog has been closed. It's the equivalent of handling the [event.](#formclosed) When the *onclose* event handler is specified, the modal dialog doesn't suspend the execution on the server but it's still shown as a modal dialog on the client. |

**Returns:** [DialogResult](https://docs.wisej.com/api/wisej.web/enumerations/wisej.web.dialogresult). One of the [DialogResult](https://docs.wisej.com/api/wisej.web/enumerations/wisej.web.dialogresult) values.

When using ShowDialog, the dialog instance is not automatically disposed when the dialog is closed because dialogs are reusable. To make sure that memory is released properly, you must dispose the instance in your code or use the typical using pattern.\
Dialogs that are closed, but not disposed and not referenced by the application will be disposed by the Garbage Collector when it kicks in.

```csharp

using (var dialog and new MyDialog())
{
  dialog.ShowDialog();
}

```

Modal dialogs suspend the code execution on the server side effectively replicating the full modal workflow employed by desktop applications. However, when the optional *onclose* parameter is specified, the dialog is modal only in the browser and doesn't suspend the server thread. Which is similar to the typical asynchronous modal pattern used in javascript.

```csharp

dialog.ShowDialog((sender, result) => {
  
  // this code is executed when the dialog is closed.
  // sender is a reference to the dialog being closed.
  // result contains the value of dialog.DialogResult.
  
  // you may dispose it here:
  sender.Dispose();
});

// this code is executed immediately, unlike the real modal workflow.

```

**Throws:**

* [ArgumentException](https://docs.microsoft.com/dotnet/api/system.argumentexception)\
  The form specified in the *owner* parameter is the same as the form being shown.
* [InvalidOperationException](https://docs.microsoft.com/dotnet/api/system.invalidoperationexception)\
  The form being shown is already visible; or The form specified in the *owner* parameter is the same as the form being shown; or the form being shown is disabled; or the form being shown is not a top-level window; or the form being shown as a dialog box is already a modal form.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) ShowDialogAsync(owner)

Asynchronously shows the form as an awaitable modal dialog box.

| Parameter                                                                                                                                                                                                               | Type                                                         | Description                                                                                                                                                                                    |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **owner** ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-723b640963c6cd781ff8c5ce5b24149fa0af7b9c%2Fbadge-optional.svg?alt=media) | [Form](https://docs.wisej.com/api/wisej.web/containers/form) | An optional [Form](https://docs.wisej.com/api/wisej.web/containers/form) that is related to this instance. This form is added to the [OwnedForms](#ownedforms) collection of the *owner* form. |

**Returns:** [Task\<DialogResult>](https://docs.microsoft.com/dotnet/api/system.threading.tasks.task-1). An awaitable [Task](https://docs.microsoft.com/dotnet/api/system.threading.tasks.task) that contains the [DialogResult](https://docs.wisej.com/api/wisej.web/enumerations/wisej.web.dialogresult) value returned asynchronous when the user closes the modal dialog.

When using ShowDialog, the dialog instance is not automatically disposed when the dialog is closed because dialogs are reusable. To make sure that memory is released properly, you must dispose the instance in your code or use the typical using pattern.\
Dialogs that are closed, but not disposed and not referenced by the application will be disposed by the Garbage Collector when it kicks in.

```csharp

using (var dialog and new MyDialog())
{
    var result = await dialog.ShowDialog();
}

```

Asynchronous Modal dialogs don't suspend the code execution on the server side but can be "awaited" in "async" methods effectively replicating the full modal workflow employed by desktop applications in an asynchronous environment.

```csharp

private async void button_Click(object sender, EventArgs e)
{
    var result = await dialog.ShowDialog();

    // this code is executed when the dialog is closed.
    // result contains the value of dialog.DialogResult.

    // you may dispose the dialog here:
    dialog.Dispose();
}

```

**Throws:**

* [InvalidOperationException](https://docs.microsoft.com/dotnet/api/system.invalidoperationexception)\
  The form being shown is already visible; or the form being shown is disabled; or the form being shown is not a top-level window; or the form being shown as a dialog box is already a modal form.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-9bf7fa01e02f4da0f9ef90d3b049ae43e664919e%2Fprotected.png?alt=media) SizeFromClientSize(clientSize)

Converts the client size into the window size.

| Parameter      | Type                                                              | Description |
| -------------- | ----------------------------------------------------------------- | ----------- |
| **clientSize** | [Size](https://docs.microsoft.com/dotnet/api/system.drawing.size) |             |

**Returns:** [Size](https://docs.microsoft.com/dotnet/api/system.drawing.size).

## Events

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Activated

[EventHandler](https://docs.microsoft.com/dotnet/api/system.eventhandler) Fired when the form is activated in code or by the user.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Deactivate

[EventHandler](https://docs.microsoft.com/dotnet/api/system.eventhandler) Fired when the form loses focus and is no longer the active form.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) FormClosed

[FormClosedEventHandler](https://docs.wisej.com/api/wisej.web/containers/form/wisej.web.formclosedeventhandler) Occurs after the form is closed.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) FormClosing

[FormClosingEventHandler](https://docs.wisej.com/api/wisej.web/containers/form/wisej.web.formclosingeventhandler) Occurs before the form is closed.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) HelpButtonClicked

[EventHandler](https://docs.microsoft.com/dotnet/api/system.eventhandler) Fired when the Help button is clicked.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Load

[EventHandler](https://docs.microsoft.com/dotnet/api/system.eventhandler) Fired before a form is displayed for the first time.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) MaximumSizeChanged

[EventHandler](https://docs.microsoft.com/dotnet/api/system.eventhandler) Fired when the value of the [MaximumSize](#maximumsize) property has changed.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) MdiChildActivate

[EventHandler](https://docs.microsoft.com/dotnet/api/system.eventhandler) Fired when a multiple-document interface (MDI) child form is activated.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) MdiChildAdded

[ControlEventHandler](https://docs.wisej.com/api/wisej.web/general/control/wisej.web.controleventhandler) Fired when a multiple-document interface (MDI) child form is added to the mdi parent.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) MdiChildRemoved

[ControlEventHandler](https://docs.wisej.com/api/wisej.web/general/control/wisej.web.controleventhandler) Fired when a multiple-document interface (MDI) child form is removed from the mdi parent.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) MinimumSizeChanged

[EventHandler](https://docs.microsoft.com/dotnet/api/system.eventhandler) Fired when the value of the [MinimumSize](#minimumsize) property has changed.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Shown

[EventHandler](https://docs.microsoft.com/dotnet/api/system.eventhandler) Fired whenever the form is first displayed.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) ToolClick

[ToolClickEventHandler](https://docs.wisej.com/api/wisej.web/editors/wisej.web.toolclickeventhandler) Fired when a [ComponentTool](https://docs.wisej.com/api/wisej.web/editors/wisej.web.componenttool) is clicked.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) WindowStateChanged

[EventHandler](https://docs.microsoft.com/dotnet/api/system.eventhandler) Fired when the value of the [WindowStateChanged](#windowstatechanged) property has changed.

## Inherited By

| Name                                                                                                         | Description                                   |
| ------------------------------------------------------------------------------------------------------------ | --------------------------------------------- |
| [FileDialogUI](https://docs.wisej.com/api/wisej.web/common-dialogs/wisej.web.filedialogui)                   | UI implementation for the FileDialog class.   |
| [FolderBrowserDialogUI](https://docs.wisej.com/api/wisej.web/common-dialogs/wisej.web.folderbrowserdialogui) | UI implementation for the FolderDialog class. |

## Implements

| Name                                                                                                 | Description                                                                                                                              |
| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| [IUserData](https://docs.wisej.com/api/wisej.web/interfaces/wisej.web.iuserdata)                     | Provides access to the `UserData` and `Tag` properties associated to the component implementing this interface.                          |
| [IBindableComponent](https://docs.wisej.com/api/wisej.web/data-binding/wisej.web.ibindablecomponent) | Bindable components implement this interface.                                                                                            |
| [IContainerControl](https://docs.wisej.com/api/wisej.web/interfaces/wisej.web.icontainercontrol)     | Provides the functionality for a control to act as a parent for other controls.                                                          |
| [IDropTarget](https://docs.wisej.com/api/wisej.web/interfaces/wisej.web.idroptarget)                 | Controls that support drag & drop operations implement this interface.                                                                   |
| [IWisejComponent](https://docs.wisej.com/api/wisej.core/interfaces/wisej.core.iwisejcomponent)       | All wisej components implement this interface.                                                                                           |
| [IWisejControl](https://docs.wisej.com/api/wisej.core/interfaces/wisej.core.iwisejcontrol)           | All wisej controls derived from the [Control](https://docs.wisej.com/api/wisej.web/general/control) class must implement this interface. |
| [IWisejWindow](https://docs.wisej.com/api/wisej.core/interfaces/wisej.core.iwisejwindow)             | All wisej top-level windows implement this interface.                                                                                    |
| [IWisejSerializable](https://docs.wisej.com/api/wisej.core/interfaces/wisej.core.iwisejserializable) | Allows an object to serialize itself.                                                                                                    |
