Windows Phone 7 Image Button

后端 未结 7 1800
抹茶落季
抹茶落季 2021-02-05 12:19

I need to create an Image Button for my application like web-oriented style. I have an image 20x20 pixel and want an image button with the same dimension of the image.

I

7条回答
  •  误落风尘
    2021-02-05 12:30

    The Button control can take most controls as its content (not just text), so you don't need an "image button" - instead, you simply need to put an Image control inside your Button like so:

    
    

    This approach (as opposed to using an ImageBrush for the Button background) means that you don't have to worry about or hardcode the sizes of the Image/Button - WP7 will handle this for you.

    Using the provided Button control instead of hooking into the manipulation events is recommended, so that you won't have to worry about things like having appropriate margins for touch targets, etc.

提交回复
热议问题