I want to create some up and down buttons using the standard button background but with black arrows.
What is the best way to accomplish this with WPF??
Malcolm
I want to create some up and down buttons using the standard button background but with black arrows.
What is the best way to accomplish this with WPF??
Malcolm
You can create a
Polygon
which represents your up and down triangles and then set them to be the content of the buttons:You can tweak these to draw different figured, but that's generally the XAML you would use for basic geometry.
No discussion on this subject would be complete without mentioning the geometry mini-language (or Path Markup Syntax) for a more compact shape definition:-
The first describes a Move to 0,6 Line to 12,6 Line to 6,0 and then close the shape (Z).
There is also a curve syntax.
The preferred way to do this now is using Segoe UI Symbol. It replaces Marlett and provides many useful glyphs. Up and down would be
This font is pre-installed on all versions of windows 7+.
If you would like to have an arrow with base rectangle you can use this sample...
I find Marlett (a font built into Windows) handy for that sort of thing.