# UserPopup

URL: https://docs.wisej.com/api/wisej.web/containers/wisej.web.userpopup

Version: 4.1
Namespace: **Wisej.Web**

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

- Control
- ScrollableControl
- ContainerControl
- [UserControl](/api/wisej.web/containers/wisej.web.usercontrol)
- [UserPopup](/api/wisej.web/containers/wisej.web.userpopup)
Provides an popup container that can be attached to other controls.

- C# - VB.NET

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

```visual
Public Class UserPopup
    Inherits UserControl
```

## Constructors

### ![Instance member](/img/api/instance.png) UserPopup()

Initializes a new instance of the UserPopup control.

### ![Instance member](/img/api/instance.png) 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

### ![Instance member](/img/api/instance.png) Alignment

[Placement](/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](/api/wisej.web/containers/wisej.web.userpopup#placementmodex) and [PlacementModeY](/api/wisej.web/containers/wisej.web.userpopup#placementmodey) properties. (Default: `BottomLeft` )

### ![Instance member](/img/api/instance.png) 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` )

### ![Instance member](/img/api/instance.png) BackColor

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

### ![Instance member](/img/api/instance.png) Offset

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

### ![Instance member](/img/api/instance.png) Opener

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

### ![Instance member](/img/api/instance.png) PlacementModeX

[PlacementMode](/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](/api/wisej.web/containers/wisej.web.userpopup#alignment) property. (Default: `KeepAlign` )

### ![Instance member](/img/api/instance.png) PlacementModeY

[PlacementMode](/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](/api/wisej.web/containers/wisej.web.userpopup#alignment) property. (Default: `KeepAlign` )

### ![Instance member](/img/api/instance.png) 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/#focusable) property is set to true. (Default: `True` )

### ![Instance member](/img/api/instance.png) Visible

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

## Methods

### ![Instance member](/img/api/instance.png) Close()

Closes the UserPopup.

### ![Protected member](/img/api/protected.png) OnClosed(e)

Fires the [Closed](/api/wisej.web/containers/wisej.web.userpopup#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. 

### ![Protected member](/img/api/protected.png) OnWebEvent(e)

Processes the event from the client.

| Parameter | Type | Description | **e** | WisejEventArgs | Event arguments. 

### ![Protected member](/img/api/protected.png) OnWebRender(config)

Renders the client component.

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

### ![Instance member](/img/api/instance.png) ShowPopup(opener, onclose)

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

| Parameter | Type | Description | **opener** | [IWisejComponent](/api/wisej.core/interfaces/wisej.core.iwisejcomponent) | The [IWisejComponent](/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, includingControl , [DataGridViewColumn](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcolumn) , [ColumnHeader](/api/wisej.web/lists-and-grids/listview/wisej.web.columnheader) , [DesktopTaskBarItem](/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritem) , [ToolBarButton](/api/wisej.web/containers/toolbar/wisej.web.toolbarbutton) . | **onclose**![optional](/img/api/badge-optional.svg) | [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.](/api/wisej.web/containers/wisej.web.userpopup#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) .

### ![Instance member](/img/api/instance.png) 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**![optional](/img/api/badge-optional.svg) | [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.](/api/wisej.web/containers/wisej.web.userpopup#closed) 

### ![Instance member](/img/api/instance.png) 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**![optional](/img/api/badge-optional.svg) | [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.](/api/wisej.web/containers/wisej.web.userpopup#closed) 

### ![Instance member](/img/api/instance.png) ShowPopupAsync(opener)

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

| Parameter | Type | Description | **opener** | [IWisejComponent](/api/wisej.core/interfaces/wisej.core.iwisejcomponent) | The [IWisejComponent](/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, includingControl , [DataGridViewColumn](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcolumn) , [ColumnHeader](/api/wisej.web/lists-and-grids/listview/wisej.web.columnheader) , [DesktopTaskBarItem](/api/wisej.web/containers/desktop/wisej.web.desktoptaskbaritem) , [ToolBarButton](/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](/api/wisej.web/containers/wisej.web.userpopup) .

### ![Instance member](/img/api/instance.png) 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) .

### ![Instance member](/img/api/instance.png) 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

### ![Instance member](/img/api/instance.png) 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) | Provides access to the `UserData` and `Tag` properties associated to the component implementing this interface. | [IBindableComponent](/api/wisej.web/data-binding/wisej.web.ibindablecomponent) | Bindable components implement this interface. | [IContainerControl](/api/wisej.web/interfaces/wisej.web.icontainercontrol) | Provides the functionality for a control to act as a parent for other controls. | [IDropTarget](/api/wisej.web/interfaces/wisej.web.idroptarget) | Controls that support drag & drop operations implement this interface. | [IWisejComponent](/api/wisej.core/interfaces/wisej.core.iwisejcomponent) | All wisej components implement this interface. | [IWisejControl](/api/wisej.core/interfaces/wisej.core.iwisejcontrol) | All wisej controls derived from theControl class must implement this interface. | [IWisejSerializable](/api/wisej.core/interfaces/wisej.core.iwisejserializable) | Allows an object to serialize itself.
