How can I add background image to radiobutton in wpf?

冷暖自知 提交于 2019-12-25 02:21:06

问题


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


回答1:


  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.



来源:https://stackoverflow.com/questions/7767667/how-can-i-add-background-image-to-radiobutton-in-wpf

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!