Solved

Change image source on button click

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

810 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