New to Telerik UI for WinForms? Download free 30-day trial

Getting Started with WinForms BrowseEditor

The following example demonstrates how to change the image of a RadButton using the RadBrowseEditor.

Figure 1: Browsed Image

WinForms RadBrowseEditor Browsed Image

1. Drag a RadBrowseEditor and a RadButton on a form.

2. Select the RadButton and in the Property Window set the DisplayStyle to Image

3. Select the RadBrowseEditor, click the Events tab of the Property Window, locate the ValueChanged event and double-click it in order to create an event handler. Replace the event handler with the following code.

private void radBrowseEditor1_ValueChanged(object sender, EventArgs e)
    this.radButton1.Image = Image.FromFile(this.radBrowseEditor1.Value);

Private Sub RadBrowseEditor1_ValueChanged(sender As Object, e As EventArgs)
    Me.RadButton1.Image = System.Drawing.Image.FromFile(Me.RadBrowseEditor1.Value)
End Sub

4. Press F5 to run the application. Press the browse button and select an image. The image is then applied to the RadButton.

See Also

Telerik UI for WinForms Learning Resources

In this article