Solved

Change image source on button click

Posted on 2010-11-27
5
943 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

706 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

18 Experts available now in Live!

Get 1:1 Help Now