How do I add an image to a Silverlight button?
-
-
Answer:
Open SilverlightOpen Silverlight editor in Macromedia Flash, click on the form you want to edit in the workspace area titled "Solution Explorer." Move down to the area of the code file where you want to add the button image.Create Your ButtonUse the Silverlight tag to create a button image by inserting the following code: <Button x:Name="btnTest" Canvas.Top="60" Canvas.Left="30" Click="btnTest_Click" Content="Click me!"></Button> The "Canvas" dictates where the button is placed; the "click" designates the function of the button when clicked and the content decides the text in the button, which is replaced when there is an image.Insert Your Image TagPlace an image tag in between the button tags to replace the custom button image with your own. Insert the name of your button image in place of the "myButtonImage.jpg" in the following code: <Button x:Name="btnTest" Canvas.Top="60" Canvas.Left="30" Click="btnTest_Click" Content="Click me!"> <Image x:Name="buttonImage" Source="/Images/myButtonImage.jpg" Width="45" Height="45" /> </Button>References:http://www.silverlightshow.net/items/Using-the-Button-control-in-Silverlight-2-Beta-1.aspx
Answerbag Staff at Answerbag.com Visit the source
Related Q & A:
- How do I add a background image to my JFrame?Best solution by Stack Overflow
- How do I burn an image onto a DVD?Best solution by Ask Ubuntu
- How do I add a "HOME" button?Best solution by User Experience
- How do I add Citation Templates for a Wiki?Best solution by Yahoo! Answers
- How can I add an attachment to a message?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.