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 change the color of button selection from white to orange.How can i dot it?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
You are going to have to play with
Visual States
of thatButton
control. Following is the default style forButton
extracted fromExpression Blend
:You will need to change the
Pressed
visual state to:(In this case background is changed to
Red
when the button is pressed)You can do this by retemplating the button control in blend.
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.
Right Click on the button -> Edit Template -> Create Copy (Just choose the defaults for the save dialogue)
Click on the "states" tab: (You'll see a list of all the different visual states the button can have)
And you're done!
Compare that to trying to edit the raw XAML, as you would have to in VS.