# Getting Started with WinForms PictureBox

This tutorial will help you to quickly get started using the control.

## Adding Telerik Assemblies Using NuGet

To use `RadPictureBox` when working with NuGet packages, install the `Telerik.UI.for.WinForms.AllControls` package. The [package target framework version may vary](https://www.telerik.com/products/winforms/documentation/visual-studio-integration/available-nugets).

Read more about NuGet installation in the [Install using NuGet Packages](https://www.telerik.com/products/winforms/documentation/installation-and-upgrades/install-using-nuget) article.

> tip With the 2025 Q1 release, the Telerik UI for WinForms has a new licensing mechanism. You can learn more about it [here](https://www.telerik.com/products/winforms/documentation/licensing/license-key).

## Adding Assembly References Manually

When dragging and dropping a control from the Visual Studio (VS) Toolbox onto the Form Designer, VS automatically adds the necessary assemblies. However, if you're adding the control programmatically, you'll need to manually reference the following assemblies:

* **Telerik.Licensing.Runtime**
* **Telerik.WinControls**
* **Telerik.WinControls.UI**
* **TelerikCommon**

The Telerik UI for WinForms assemblies can be installed by using one of the available [installation approaches](https://www.telerik.com/products/winforms/documentation/installation-and-upgrades/installing-on-your-computer).

## Defining the RadPictureBox

To start using the control you only need to add a **RadPictureBox** control to the form either at design time by dragging it from the toolbox and dropping it into the form or via code. From the smart tag you can dock the control in parent's container.

By default, the control is shown with no image icon:

![WinForms RadPictureBox Default View](https://www.telerik.com/products/winforms/documentation/assets/f64178c3d222b9be547f158f52d2d5b2/picturebox-getting-started001.png)

### Customize Default Look When there is No Image

You can use the **DefaultSvgImage/DefaultImage** and **DefaultText** properties to customize both the image icon and text according to your needs:

```C#
this.radPictureBox1.DefaultSvgImage = RadSvgImage.FromFile(@"..//..//PictureBox//noimage.svg");
this.radPictureBox1.DefaultText = "No image available";
```

```VB.NET
Me.RadPictureBox1.DefaultSvgImage = RadSvgImage.FromFile("..//..//PictureBox//noimage.svg")
Me.RadPictureBox1.DefaultText = "No image available"
```

To change the color of the default text, set the `ForeColor` property of the `NoPictureTextElement`:

```C#
this.radPictureBox1.PictureBoxElement.NoPictureTextElement.ForeColor = System.Drawing.Color.Red;
```

```VB.NET
Me.radPictureBox1.PictureBoxElement.NoPictureTextElement.ForeColor = System.Drawing.Color.Red
```

![WinForms RadPictureBox Customize Default Look](https://www.telerik.com/products/winforms/documentation/assets/c5a9f3a7162326390d1c2f3bcff1ff76/picturebox-getting-started003.png)

### Load an Image

To load an image in **RadPictureBox** control you can use **SvgImage** or **Image** property:

* **Load an image**:

```C#
this.radPictureBox1.Image = Image.FromFile(@"..//..//PictureBox//emoticon-happy.png");
```

```VB.NET
Me.RadPictureBox1.Image = Image.FromFile("..//..//PictureBox//emoticon-happy.png")
```

* **Load SVG image**:

```C#
this.radPictureBox1.SvgImage = RadSvgImage.FromFile(@"..//..//PictureBox//emoticon-happy.svg");
```

```VB.NET
Me.RadPictureBox1.SvgImage = RadSvgImage.FromFile("..//..//PictureBox//emoticon-happy.svg")
```

![WinForms RadPictureBox Load an Image](https://www.telerik.com/products/winforms/documentation/assets/2f6932395e4c684963e4244973917130/picturebox-getting-started002.png)

### ImageLoaded Event

The **ImageLoaded** event is fired when an image is successfully loaded into the **RadPictureBox** control, whether from a file or from the clipboard. As of Q1 2026, this event provides detailed information about the loaded image through the **PictureBoxImageLoadedEventArgs** class.

#### Event Arguments

The **PictureBoxImageLoadedEventArgs** class exposes the following useful properties:

| Property        | Type             | Description                                                                                                                |
| --------------- | ---------------- | -------------------------------------------------------------------------------------------------------------------------- |
| **ImageKind**   | ImageKind        | Gets the kind of image that was loaded (Raster or Vector).                                                                 |
| **LoadContext** | LoadImageContext | Gets the context from which the image was loaded (File or Clipboard).                                                      |
| **FilePath**    | string           | Gets the file path from which the image was loaded. This property is valid only when LoadContext is LoadImageContext.File. |

> note The event handler signature uses the base `EventArgs` type. To access the properties listed above, you need to cast the event arguments to `PictureBoxImageLoadedEventArgs`.

#### Example Usage

The following example demonstrates how to use the **ImageLoaded** event to update the window title with information about the loaded image:

```C#
private void RadPictureBox1_ImageLoaded(object sender, EventArgs e)
{
    if (e is PictureBoxImageLoadedEventArgs args)
    {
        string title = "Image Viewer";

        if (args.LoadContext == LoadImageContext.File && !string.IsNullOrEmpty(args.FilePath))
        {
            var fileInfo = new FileInfo(args.FilePath);
            title = $"Image Viewer - {fileInfo.Name} ({args.ImageKind})";
        }
        else if (args.LoadContext == LoadImageContext.Clipboard)
        {
            title = $"Image Viewer - Clipboard Image ({args.ImageKind})";
        }
        
        this.Text = title;
    }
}

```

```VB.NET
Private Sub RadPictureBox1_ImageLoaded(sender As Object, e As EventArgs)
    Dim args As PictureBoxImageLoadedEventArgs = TryCast(e, PictureBoxImageLoadedEventArgs)
    If args IsNot Nothing Then
        Dim title As String = "Image Viewer"
        
        If args.LoadContext = LoadImageContext.File AndAlso Not String.IsNullOrEmpty(args.FilePath) Then
            Dim fileInfo As New FileInfo(args.FilePath)
            title = $"Image Viewer - {fileInfo.Name} ({args.ImageKind})"
        ElseIf args.LoadContext = LoadImageContext.Clipboard Then
            title = $"Image Viewer - Clipboard Image ({args.ImageKind})"
        End If
        
        Me.Text = title
    End If
End Sub

```

## See Also

* [Overview](https://www.telerik.com/products/winforms/documentation/controls/picturebox/overview)
* [Structure](https://www.telerik.com/products/winforms/documentation/controls/picturebox/structure)

## Telerik UI for WinForms Learning Resources

* [Telerik UI for WinForms Picturebox Component](https://www.telerik.com/products/winforms/picturebox.aspx)
* [Getting Started with Telerik UI for WinForms Components](https://docs.telerik.com/devtools/winforms/getting-started/first-steps)
* [Telerik UI for WinForms Setup](https://docs.telerik.com/devtools/winforms/installation-and-upgrades/installing-on-your-computer)
* [Telerik UI for WinForms Converter](https://www.telerik.com/products/winforms/documentation/ai-coding-assistant/converter/converter)
* [Telerik UI for WinForms Visual Studio Templates](https://docs.telerik.com/devtools/winforms/visual-studio-integration/visual-studio-templates)
* [Deploy Telerik UI for WinForms Applications](https://docs.telerik.com/devtools/winforms/deployment-and-distribution/application-deployment)
* [Telerik UI for WinForms Virtual Classroom(Training Courses for Registered Users)](https://learn.telerik.com/learn/course/external/view/elearning/17/telerik-ui-for-winforms)
* [Telerik UI for WinForms License Agreement)](https://www.telerik.com/purchase/license-agreement/winforms-dlw-s)
