# UserPopup

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)
      * [UserControl](https://docs.wisej.com/api/wisej.web/containers/wisej.web.usercontrol)
        * [UserPopup](https://docs.wisej.com/api/wisej.web/containers/wisej.web.userpopup)

Provides an popup container that can be attached to other controls.

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

```csharp
public class UserPopup : UserControl
```

{% endtab %}

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

```visual-basic
Public Class UserPopup
    Inherits UserControl
```

{% 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) UserPopup()

Initializes a new instance of the UserPopup 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) UserPopup(container)

Initializes a new instance of the UserPopup control.

| Name          | Type                                                                                 | Description                                                                                                                                 |
| ------------- | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------- |
| **container** | [IContainer](https://docs.microsoft.com/dotnet/api/system.componentmodel.icontainer) | A [IContainer](https://docs.microsoft.com/dotnet/api/system.componentmodel.icontainer) that represents the container for the popup control. |

## 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) Alignment

[Placement](https://docs.wisej.com/api/wisej.web/enumerations/wisej.web.placement): Returns or sets the alignment side and position of the popup. The actual location depends on the placement methods defined by the [PlacementModeX](#placementmodex) and [PlacementModeY](#placementmodey) properties. (Default: `BottomLeft`)

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

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Determines whether the popup will close automatically when the user clicks outside of the control. (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) BackColor

[Color](https://docs.microsoft.com/dotnet/api/system.drawing.color): Returns or sets the background color for the 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) Offset

[Padding](https://docs.wisej.com/api/wisej.web/general/wisej.web.padding): Returns or sets the offset in pixels from the calculated position of the popup.

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

[IWisejComponent](https://docs.wisej.com/api/wisej.core/interfaces/wisej.core.iwisejcomponent): Returns the opener [Control](https://docs.wisej.com/api/wisej.web/general/control). It may be null if the popup was shown without specifying an opener.

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

[PlacementMode](https://docs.wisej.com/api/wisej.web/enumerations/wisej.web.placementmode): Returns or sets the method used to calculate the position of the popup according to the value of the [Alignment](#alignment) property. (Default: `KeepAlign`)

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

[PlacementMode](https://docs.wisej.com/api/wisej.web/enumerations/wisej.web.placementmode): Returns or sets the method used to calculate the position of the popup according to the value of the [Alignment](#alignment) property. (Default: `KeepAlign`)

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

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets whether the user can give the focus to this control using the TAB key and the [Focusable](https://docs.wisej.com/api/general/control#focusable) property is set to true. (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) Visible

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets whether the control and all its child controls are displayed.

## 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) Close()

Closes the UserPopup.

### ![](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 when the popup is closed.

| 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) 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-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) ShowPopup(opener, onclose)

Shows the UserPopup in relation to the specified *opener* .

| Parameter                                                                                                                                                                                                                 | Type                                                                                           | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **opener**                                                                                                                                                                                                                | [IWisejComponent](https://docs.wisej.com/api/wisej.core/interfaces/wisej.core.iwisejcomponent) | The [IWisejComponent](https://docs.wisej.com/api/wisej.core/interfaces/wisej.core.iwisejcomponent) that this UserPopup is bound to. It can be any component that is visually displayed on the client side, including [Control](https://docs.wisej.com/api/wisej.web/general/control), [DataGridViewColumn](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcolumn), [ColumnHeader](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.columnheader), [DesktopTaskBarItem](https://docs.wisej.com/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritem), [ToolBarButton](https://docs.wisej.com/api/wisej.web/containers/toolbar/wisej.web.toolbarbutton). |
| **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\<UserPopup>](https://docs.microsoft.com/dotnet/api/system.action-1)                    | Optional async handler for the close event; called when the popup panel disappears. It's the equivalent of handling the [event.](#closed)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception)*opener* is null.
* [ArgumentException](https://docs.microsoft.com/dotnet/api/system.argumentexception)*opener* is the same [UserPopup](https://docs.wisej.com/api/wisej.web/containers/wisej.web.userpopup).

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

Shows the UserPopup at the specified screen coordinates.

| Parameter                                                                                                                                                                                                                 | Type                                                                        | Description                                                                                                                               |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| **x**                                                                                                                                                                                                                     | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                 | The horizontal position in pixels, relative to the screen.                                                                                |
| **y**                                                                                                                                                                                                                     | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                 | The vertical position in pixels, relative to the screen.                                                                                  |
| **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\<UserPopup>](https://docs.microsoft.com/dotnet/api/system.action-1) | Optional async handler for the close event; called when the popup panel disappears. It's the equivalent of handling the [event.](#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) ShowPopup(location, onclose)

Shows the UserPopup at the specified screen location.

| Parameter                                                                                                                                                                                                                 | Type                                                                        | Description                                                                                                                               |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| **location**                                                                                                                                                                                                              | [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point)         | The location in pixels, relative to the screen.                                                                                           |
| **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\<UserPopup>](https://docs.microsoft.com/dotnet/api/system.action-1) | Optional async handler for the close event; called when the popup panel disappears. It's the equivalent of handling the [event.](#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) ShowPopupAsync(opener)

Asynchronously displays the UserPopup in relation to the specified *opener* .

| Parameter  | Type                                                                                           | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ---------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **opener** | [IWisejComponent](https://docs.wisej.com/api/wisej.core/interfaces/wisej.core.iwisejcomponent) | The [IWisejComponent](https://docs.wisej.com/api/wisej.core/interfaces/wisej.core.iwisejcomponent) that this UserPopup is bound to. It can be any component that is visually displayed on the client side, including [Control](https://docs.wisej.com/api/wisej.web/general/control), [DataGridViewColumn](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcolumn), [ColumnHeader](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.columnheader), [DesktopTaskBarItem](https://docs.wisej.com/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritem), [ToolBarButton](https://docs.wisej.com/api/wisej.web/containers/toolbar/wisej.web.toolbarbutton). |

**Returns:** [Task](https://docs.microsoft.com/dotnet/api/system.threading.tasks.task).

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception)*opener* is null.
* [ArgumentException](https://docs.microsoft.com/dotnet/api/system.argumentexception)*opener* is the same [UserPopup](https://docs.wisej.com/api/wisej.web/containers/wisej.web.userpopup).

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

Asynchronously displays the UserPopup at the specified screen coordinates.

| Parameter | Type                                                        | Description                                                |
| --------- | ----------------------------------------------------------- | ---------------------------------------------------------- |
| **x**     | [Int32](https://docs.microsoft.com/dotnet/api/system.int32) | The horizontal position in pixels, relative to the screen. |
| **y**     | [Int32](https://docs.microsoft.com/dotnet/api/system.int32) | The vertical position in pixels, relative to the screen.   |

**Returns:** [Task](https://docs.microsoft.com/dotnet/api/system.threading.tasks.task).

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

Asynchronously displays the UserPopup at the specified screen location.

| Parameter    | Type                                                                | Description                                     |
| ------------ | ------------------------------------------------------------------- | ----------------------------------------------- |
| **location** | [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point) | The location in pixels, relative to the screen. |

**Returns:** [Task](https://docs.microsoft.com/dotnet/api/system.threading.tasks.task).

## 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) Closed

[EventHandler](https://docs.microsoft.com/dotnet/api/system.eventhandler) Fired when the UserPopup control is closed.

## 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. |
| [IWisejSerializable](https://docs.wisej.com/api/wisej.core/interfaces/wisej.core.iwisejserializable) | Allows an object to serialize itself.                                                                                                    |
