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

Trying_to_LearnAsked:
Who is Participating?
 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.