• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 976
  • Last Modified:

Change image source on button click

Hi,

I need to change the source of an image on button click.

This is the code I have typed but the error I am getting is

"Value of type string cannot be converted into 'system.windows.media.imagesource'
Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles Button1.Click
            Dim ImageURI As String = ("/MoviesOnTheGo;component/DueDate.png")
            Image_Poster.Source = ImageURI
        End Sub

Open in new window

0
Trying_to_Learn
Asked:
Trying_to_Learn
  • 2
  • 2
1 Solution
 
JOHNFROGCommented:
try using

Image_Poster.imageURL

instead of

Image_Poster.source
0
 
Trying_to_LearnAuthor Commented:
Image_Poster.imageURL  Does not exist
the only property available in image is ImageFailedEvent
0
 
Trying_to_LearnAuthor Commented:
Thanks!
0
 
CodeCruiserCommented:
Glad to help :-)
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now