# UserPopup

Namespace: **Wisej.Web**

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

* [Control](/api/wisej.web/general/control.md)
  * [ScrollableControl](/api/wisej.web/containers/scrollablecontrol.md)
    * [ContainerControl](/api/wisej.web/containers/containercontrol.md)
      * [UserControl](/api/wisej.web/containers/wisej.web.usercontrol.md)
        * [UserPopup](/api/wisej.web/containers/wisej.web.userpopup.md)

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

### ![](/files/hsR4ok3152WyAf8J2C1u) UserPopup()

Initializes a new instance of the UserPopup control.

### ![](/files/hsR4ok3152WyAf8J2C1u) 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

### ![](/files/hsR4ok3152WyAf8J2C1u) Alignment

[Placement](/api/wisej.web/enumerations/wisej.web.placement.md): 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`)

### ![](/files/hsR4ok3152WyAf8J2C1u) 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`)

### ![](/files/hsR4ok3152WyAf8J2C1u) BackColor

[Color](https://docs.microsoft.com/dotnet/api/system.drawing.color): Returns or sets the background color for the control.

### ![](/files/hsR4ok3152WyAf8J2C1u) Offset

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

### ![](/files/hsR4ok3152WyAf8J2C1u) Opener

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

### ![](/files/hsR4ok3152WyAf8J2C1u) PlacementModeX

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

### ![](/files/hsR4ok3152WyAf8J2C1u) PlacementModeY

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

### ![](/files/hsR4ok3152WyAf8J2C1u) 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](/api/wisej.web/general/control.md#focusable) property is set to true. (Default: `True`)

### ![](/files/hsR4ok3152WyAf8J2C1u) Visible

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

## Methods

### ![](/files/hsR4ok3152WyAf8J2C1u) Close()

Closes the UserPopup.

### ![](/files/lzopMboA31bVq8UIcbT3) 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. |

### ![](/files/lzopMboA31bVq8UIcbT3) OnWebEvent(e)

Processes the event from the client.

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

### ![](/files/lzopMboA31bVq8UIcbT3) OnWebRender(config)

Renders the client component.

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

### ![](/files/hsR4ok3152WyAf8J2C1u) ShowPopup(opener, onclose)

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

| Parameter                                    | Type                                                                        | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| -------------------------------------------- | --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **opener**                                   | [IWisejComponent](/api/wisej.core/interfaces/wisej.core.iwisejcomponent.md) | The [IWisejComponent](/api/wisej.core/interfaces/wisej.core.iwisejcomponent.md) that this UserPopup is bound to. It can be any component that is visually displayed on the client side, including [Control](/api/wisej.web/general/control.md), [DataGridViewColumn](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcolumn.md), [ColumnHeader](/api/wisej.web/lists-and-grids/listview/wisej.web.columnheader.md), [DesktopTaskBarItem](/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritem.md), [ToolBarButton](/api/wisej.web/containers/toolbar/wisej.web.toolbarbutton.md). |
| **onclose** ![](/files/1vGqtbG2j637vQ4ROWOf) | [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](/api/wisej.web/containers/wisej.web.userpopup.md).

### ![](/files/hsR4ok3152WyAf8J2C1u) 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** ![](/files/1vGqtbG2j637vQ4ROWOf) | [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) |

### ![](/files/hsR4ok3152WyAf8J2C1u) 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** ![](/files/1vGqtbG2j637vQ4ROWOf) | [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) |

### ![](/files/hsR4ok3152WyAf8J2C1u) ShowPopupAsync(opener)

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

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

**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](/api/wisej.web/containers/wisej.web.userpopup.md).

### ![](/files/hsR4ok3152WyAf8J2C1u) 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).

### ![](/files/hsR4ok3152WyAf8J2C1u) 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

### ![](/files/hsR4ok3152WyAf8J2C1u) Closed

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

## Implements

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wisej.com/api/wisej.web/containers/wisej.web.userpopup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
