Coenni
Coenni

Reputation: 197

How can I add background image to radiobutton in wpf?

How can I add an image to the radiobutton in WPF dynamically? is it possible?

Upvotes: 0

Views: 1944

Answers (1)

Vinit Sankhe
Vinit Sankhe

Reputation: 19895

  myRadioButton.Content
      = new Image()
                {
                   Source =
                       (new ImageSourceConverter()).ConvertFrom(
                         "Images/pic.png") as
                             ImageSource
                }; 

This code will load an image "pic.png" in a radio button from local "Images" folder from same assembly.

Upvotes: 1

Related Questions