# PictureBox

Namespace: **Wisej.Web**

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

* [Control](/api/wisej.web/general/control.md)
  * [PictureBox](/api/wisej.web/content/wisej.web.picturebox.md)

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

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

Initializes a new instance of the [PictureBox](/api/wisej.web/content/wisej.web.picturebox.md) class.

### ![](/files/hsR4ok3152WyAf8J2C1u) PictureBox(image, sizeMode)

Initializes a new instance of the [PictureBox](/api/wisej.web/content/wisej.web.picturebox.md) 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](/api/wisej.web/enumerations/wisej.web.pictureboxsizemode.md) | The size mode for the picture box, optional and defaults to PictureBoxSizeMode.Normal. |

### ![](/files/hsR4ok3152WyAf8J2C1u) PictureBox(imageSource, sizeMode)

Initializes a new instance of the [PictureBox](/api/wisej.web/content/wisej.web.picturebox.md) 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](/api/wisej.web/enumerations/wisej.web.pictureboxsizemode.md) | The size mode for the picture box, optional and defaults to PictureBoxSizeMode.Normal. |

### ![](/files/hsR4ok3152WyAf8J2C1u) PictureBox(location, size)

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

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

### ![](/files/hsR4ok3152WyAf8J2C1u) PictureBox(image, location, size, sizeMode)

Initializes a new instance of the [PictureBox](/api/wisej.web/content/wisej.web.picturebox.md) 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](/api/wisej.web/editors/wisej.web.textbox.md) on its parent control.                                         |
| **size**     | [Size](https://docs.microsoft.com/dotnet/api/system.drawing.size)                 | The size of the [TextBox](/api/wisej.web/editors/wisej.web.textbox.md).                                                                   |
| **sizeMode** | [PictureBoxSizeMode](/api/wisej.web/enumerations/wisej.web.pictureboxsizemode.md) | The size mode for the picture box, optional and defaults to [Normal](/api/wisej.web/enumerations/wisej.web.pictureboxsizemode.md#fields). |

### ![](/files/hsR4ok3152WyAf8J2C1u) PictureBox(imageSource, location, size, sizeMode)

Initializes a new instance of the [PictureBox](/api/wisej.web/content/wisej.web.picturebox.md) 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](/api/wisej.web/editors/wisej.web.textbox.md) on its parent control.                                         |
| **size**        | [Size](https://docs.microsoft.com/dotnet/api/system.drawing.size)                 | The size of the [TextBox](/api/wisej.web/editors/wisej.web.textbox.md).                                                                   |
| **sizeMode**    | [PictureBoxSizeMode](/api/wisej.web/enumerations/wisej.web.pictureboxsizemode.md) | The size mode for the picture box, optional and defaults to [Normal](/api/wisej.web/enumerations/wisej.web.pictureboxsizemode.md#fields). |

## Properties

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

[BorderStyle](/api/wisej.web/enumerations/wisej.web.borderstyle.md): Indicates the border style for the control. (Default: `None`)

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

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

### ![](/files/lzopMboA31bVq8UIcbT3) DefaultSize

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

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

[DialogResult](/api/wisej.web/enumerations/wisej.web.dialogresult.md): Returns or sets a value that is returned to the parent form when the button is clicked. (Default: `None`)

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

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

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

### ![](/files/hsR4ok3152WyAf8J2C1u) 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](/api/wisej.web/content/wisej.web.picturebox.md).

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

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

## Methods

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

### ![](/files/hsR4ok3152WyAf8J2C1u) 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](/api/wisej.web/content/wisej.web.picturebox.md). |

### ![](/files/hsR4ok3152WyAf8J2C1u) 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](/api/wisej.web/content/wisej.web.picturebox.md). |

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

Fires the [Click](/api/wisej.web/general/control.md#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. |

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

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

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

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

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

## Events

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

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

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

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

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

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

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