使用vb.net从CodeBehind更改WPF中的LargeImageSourse

时间:2015-01-02 17:18:29

标签: wpf vb.net

我是WPF的新手,我开始使用功能区:RibbonButton如下:

<ribbon:RibbonButton x:Name="ServerCondition" Label="Server" FontFamily="Palatino Linotype" FontSize="12" BorderThickness="0" Height="50" CornerRadius="10" LargeImageSource="/Economy;component/Images/server_down.ico"/>

现在要从后面的代码中动态地将LargeImageSourse改为另一个 首先,我不知道这是否可行 如果它不可能......我可以用什么控制来改变图标?
如果有人帮助我,我会感激不尽。

1 个答案:

答案 0 :(得分:1)

在您的代码中,您可以像这样更改它:

ServerCondition.LargeImageSource = new BitmapImage(new Uri("your uri"));

How to load image to WPF in runtime?

相关问题