使用 vb.net 从 CodeBehind 更改 WPF 中的 LargeImageSourse
Change LargeImageSourse in WPF from CodeBehind using vb.net
我是 WPF 新手,我开始使用 ribbon: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 更改为另一个。
首先我不知道这是否可行。
如果不可能……我可以使用什么控件来更改图标?
如果有人能帮助我,我将不胜感激。
在您后面的代码中,您可以这样更改它:
ServerCondition.LargeImageSource = new BitmapImage(new Uri("your uri"));
How to load image to WPF in runtime?
我是 WPF 新手,我开始使用 ribbon: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 更改为另一个。
首先我不知道这是否可行。
如果不可能……我可以使用什么控件来更改图标?
如果有人能帮助我,我将不胜感激。
在您后面的代码中,您可以这样更改它:
ServerCondition.LargeImageSource = new BitmapImage(new Uri("your uri"));
How to load image to WPF in runtime?