Monday, December 6, 2010

WPF Create Menu Icon On The Fly

I needed to retrieve a remote image url and use it as a menu item in my vb.net wpf application.

Did it as so where mnuTitle is the menu item to have the icon changed.
This should work with Silverlight as well.

Dim ico As New Image
 ico.Source = New BitmapImage(New Uri("http://www.site.com/image.jpg",UriKind.RelativeOrAbsolute))
 mnuTitle.Icon = ico

No comments:

Post a Comment