# PictureBox

Namespace: **Wisej.Web**

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

* [Control](https://docs.wisej.com/api/wisej.web/general/control)
  * [PictureBox](https://docs.wisej.com/api/wisej.web/content/wisej.web.picturebox)

Represents an image control.

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

```csharp
public class PictureBox : Control, ISupportInitialize, IButtonControl, IImage, ICommandSource
```

{% endtab %}

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

```visual-basic
Public Class PictureBox
    Inherits Control
    Implements ISupportInitialize, IButtonControl, IImage, ICommandSource
```

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

Initializes a new instance of the [PictureBox](https://docs.wisej.com/api/wisej.web/content/wisej.web.picturebox) class.

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

Initializes a new instance of the [PictureBox](https://docs.wisej.com/api/wisej.web/content/wisej.web.picturebox) class with specified settings.

| Name         | Type                                                                                                 | Description                                                                            |
| ------------ | ---------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| **image**    | [Image](https://docs.microsoft.com/dotnet/api/system.drawing.image)                                  | The [Image](#image) object to display in the picture box.                              |
| **sizeMode** | [PictureBoxSizeMode](https://docs.wisej.com/api/wisej.web/enumerations/wisej.web.pictureboxsizemode) | The size mode for the picture box, optional and defaults to PictureBoxSizeMode.Normal. |

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

Initializes a new instance of the [PictureBox](https://docs.wisej.com/api/wisej.web/content/wisej.web.picturebox) class with specified settings.

| Name            | Type                                                                                                 | Description                                                                            |
| --------------- | ---------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| **imageSource** | [String](https://docs.microsoft.com/dotnet/api/system.string)                                        | The source path of the image to display in the picture box.                            |
| **sizeMode**    | [PictureBoxSizeMode](https://docs.wisej.com/api/wisej.web/enumerations/wisej.web.pictureboxsizemode) | The size mode for the picture box, optional and defaults to PictureBoxSizeMode.Normal. |

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

Initializes a new instance of the [PictureBox](https://docs.wisej.com/api/wisej.web/content/wisej.web.picturebox) class with specified settings.

| Name         | Type                                                                | Description                                                                                                          |
| ------------ | ------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| **location** | [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point) | The location of the [TextBox](https://docs.wisej.com/api/wisej.web/editors/wisej.web.textbox) on its parent control. |
| **size**     | [Size](https://docs.microsoft.com/dotnet/api/system.drawing.size)   | The size of the [TextBox](https://docs.wisej.com/api/wisej.web/editors/wisej.web.textbox).                           |

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

Initializes a new instance of the [PictureBox](https://docs.wisej.com/api/wisej.web/content/wisej.web.picturebox) class with specified settings.

| Name         | Type                                                                                                 | Description                                                                                                                                        |
| ------------ | ---------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| **image**    | [Image](https://docs.microsoft.com/dotnet/api/system.drawing.image)                                  | The [Image](#image) object to display in the picture box.                                                                                          |
| **location** | [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point)                                  | The location of the [TextBox](https://docs.wisej.com/api/wisej.web/editors/wisej.web.textbox) on its parent control.                               |
| **size**     | [Size](https://docs.microsoft.com/dotnet/api/system.drawing.size)                                    | The size of the [TextBox](https://docs.wisej.com/api/wisej.web/editors/wisej.web.textbox).                                                         |
| **sizeMode** | [PictureBoxSizeMode](https://docs.wisej.com/api/wisej.web/enumerations/wisej.web.pictureboxsizemode) | The size mode for the picture box, optional and defaults to [Normal](https://docs.wisej.com/api/enumerations/wisej.web.pictureboxsizemode#fields). |

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

Initializes a new instance of the [PictureBox](https://docs.wisej.com/api/wisej.web/content/wisej.web.picturebox) class with specified settings.

| Name            | Type                                                                                                 | Description                                                                                                                                        |
| --------------- | ---------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| **imageSource** | [String](https://docs.microsoft.com/dotnet/api/system.string)                                        | The source path of the image to display in the picture box.                                                                                        |
| **location**    | [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point)                                  | The location of the [TextBox](https://docs.wisej.com/api/wisej.web/editors/wisej.web.textbox) on its parent control.                               |
| **size**        | [Size](https://docs.microsoft.com/dotnet/api/system.drawing.size)                                    | The size of the [TextBox](https://docs.wisej.com/api/wisej.web/editors/wisej.web.textbox).                                                         |
| **sizeMode**    | [PictureBoxSizeMode](https://docs.wisej.com/api/wisej.web/enumerations/wisej.web.pictureboxsizemode) | The size mode for the picture box, optional and defaults to [Normal](https://docs.wisej.com/api/enumerations/wisej.web.pictureboxsizemode#fields). |

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

[BorderStyle](https://docs.wisej.com/api/wisej.web/enumerations/wisej.web.borderstyle): Indicates the border style for the control. (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) Command

[ICommand](https://docs.wisej.com/api/wisej.web/interfaces/wisej.web.icommand): Returns or sets the [ICommand](https://docs.wisej.com/api/wisej.web/interfaces/wisej.web.icommand) implementation to invoke. (Default: `null`)

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

[Size](https://docs.microsoft.com/dotnet/api/system.drawing.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) DialogResult

[DialogResult](https://docs.wisej.com/api/wisej.web/enumerations/wisej.web.dialogresult): Returns or sets a value that is returned to the parent form when the button is clicked. (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) Filter

[String](https://docs.microsoft.com/dotnet/api/system.string): Returns or sets the filter ([filter](https://developer.mozilla.org/en-US/docs/Web/CSS/filter)) to apply to the picture. (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) Image

[Image](https://docs.microsoft.com/dotnet/api/system.drawing.image): Returns or sets the image that is displayed by [PictureBox](https://docs.wisej.com/api/wisej.web/content/wisej.web.picturebox).

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

[String](https://docs.microsoft.com/dotnet/api/system.string): Returns or sets the theme name or URL for the image to display in the [PictureBox](https://docs.wisej.com/api/wisej.web/content/wisej.web.picturebox).

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

[PictureBoxSizeMode](https://docs.wisej.com/api/wisej.web/enumerations/wisej.web.pictureboxsizemode): Indicates how the image is displayed. (Default: `Normal`)

## Methods

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

Disposes the control.

| 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-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Load(url)

Sets the [ImageSource](#imagesource) to the specified URL and displays the image indicated.

| Parameter | Type                                                          | Description                                                                                                               |
| --------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| **url**   | [String](https://docs.microsoft.com/dotnet/api/system.string) | The path for the image to display in the [PictureBox](https://docs.wisej.com/api/wisej.web/content/wisej.web.picturebox). |

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

Loads the image at the specified location, asynchronously.

| Parameter | Type                                                          | Description                                                                                                               |
| --------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| **url**   | [String](https://docs.microsoft.com/dotnet/api/system.string) | The path for the image to display in the [PictureBox](https://docs.wisej.com/api/wisej.web/content/wisej.web.picturebox). |

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

Fires the [Click](https://docs.wisej.com/api/general/control#click) 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) OnCommandChanged(e)

Fires the [CommandChanged](#commandchanged) 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) OnLoadCompleted(e)

Fires the [LoadCompleted](#loadcompleted) 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) OnSizeModeChanged(e)

Fires the [SizeModeChanged](#sizemodechanged) 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) 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) PerformClick()

Generates a [Click](https://docs.wisej.com/api/general/control#click) event for the [LinkLabel](https://docs.wisej.com/api/wisej.web/content/linklabel) control.

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

[EventHandler](https://docs.microsoft.com/dotnet/api/system.eventhandler) Fired when the [Command](#command) property value changes.

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

[EventHandler](https://docs.microsoft.com/dotnet/api/system.eventhandler) Fired when the asynchronous image-load operation is completed.

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

[EventHandler](https://docs.microsoft.com/dotnet/api/system.eventhandler) Fired when [SizeMode](#sizemode) changes.

## 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.                                                                                            |
| [IButtonControl](https://docs.wisej.com/api/wisej.web/interfaces/wisej.web.ibuttoncontrol)           | Allows a control to act like a button on a [Form](https://docs.wisej.com/api/wisej.web/containers/form).                                 |
| [ICommandSource](https://docs.wisej.com/api/wisej.web/interfaces/wisej.web.icommandsource)           | Defines an object that can invoke a [Command](https://docs.wisej.com/api/interfaces/wisej.web.icommandsource#command).                   |
| [IDropTarget](https://docs.wisej.com/api/wisej.web/interfaces/wisej.web.idroptarget)                 | Controls that support drag & drop operations implement this interface.                                                                   |
| [IImage](https://docs.wisej.com/api/wisej.web/interfaces/wisej.web.iimage)                           | Provides access to common image properties across the controls that 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.                                                                                                    |
