Solved

Change image source on button click

Posted on 2010-11-27
5
955 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

717 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