I am trying to declare a button named “viewButton” with a image as the background of the button. How can i go about doing it can anyone help me with it?
Below is the code i tired but is not a correct one.
Code:
viewButton.Background = “/AlarmClock;component/Images/page_preview.png”;
just make sure the file is maked as “Resource” in visual studio. Alternatively you can mark it as “Content” and use it like this:
I don’t know if you need to assign the background programatically (because you can do it in markup), but if you do here is what you need to say:
[FURTHER]
in order set margin programmatically: