Solved

Change image source on button click

Posted on 2010-11-27
5
946 Views
Last Modified: 2012-05-10
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
Comment
Question by:Trying_to_Learn
  • 2
  • 2
5 Comments
 

Expert Comment

by:JOHNFROG
ID: 34223961
try using

Image_Poster.imageURL

instead of

Image_Poster.source
0
 

Author Comment

by:Trying_to_Learn
ID: 34223978
Image_Poster.imageURL  Does not exist
the only property available in image is ImageFailedEvent
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 34233530
0
 

Author Closing Comment

by:Trying_to_Learn
ID: 34248378
Thanks!
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 34248409
Glad to help :-)
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now