How to change color of button when clicked in WP7?

后端 未结 3 1553
故里飘歌
故里飘歌 2021-01-03 05:31

In WP7 whenever a button is clicked ,the background of button becomes white showing that button is clicked and becomes normal on releasing the mouse button.But I want to cha

3条回答
  •  一向
    一向 (楼主)
    2021-01-03 05:54

    If you're developing for Windows phone, Blend is free and it's an incredibly powerful. I would go so far as to say mandatory, I highly recommend you use it. In Blend it's a simple matter of editing the "Pressed" state style.

    1. In Visual studio, in Solution Explorer, right click on your XAML page and select "open in Expression Blend"
    2. Right Click on the button -> Edit Template -> Create Copy (Just choose the defaults for the save dialogue)

    3. Click on the "states" tab: (You'll see a list of all the different visual states the button can have)

    4. Select the "Pressed" state and edit away to your heats content, visually.

    And you're done!

    Compare that to trying to edit the raw XAML, as you would have to in VS.

提交回复
热议问题