user1119308
user1119308

Reputation: 79

WPF button background with two shapes

I want to have a button with 2 background colors, diveded by a part of a elipse. Like this:

enter image description here

Whats the best way two implement this? I can't find it on the web :(

Upvotes: 1

Views: 278

Answers (1)

Isak Savo
Isak Savo

Reputation: 35884

Put the rectangle and the ellipse in your controltemplate for the button (I suggest you start from the SimpleButton style in Expression Blend) just like you have in your drawing.

You can then set ClipToBounds to true on the parent border to make the parts outside the black border hidden.

Upvotes: 1

Related Questions