Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF - Create buttons with up and down arrows using standard buttons

Tags:

button

wpf

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

like image 330
Malcolm Avatar asked Jan 11 '09 04:01

Malcolm


2 Answers

I find Marlett (a font built into Windows) handy for that sort of thing.

<Button FontFamily="Marlett" FontSize="20" Content="5"/>
<Button FontFamily="Marlett" FontSize="20" Content="6"/>

Output:

enter image description here

like image 196
Matt Hamilton Avatar answered Oct 31 '22 12:10

Matt Hamilton


No discussion on this subject would be complete without mentioning the geometry mini-language (or Path Markup Syntax) for a more compact shape definition:-

  <Button>
    <Path Fill="Black" Data="M 0 6 L 12 6 L 6 0 Z"/>
  </Button>
  <Button>
    <Path Fill="Black" Data="M 0 0 L 6 6 L 12 0 Z"/>
  </Button>

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.

like image 115
Rhys Avatar answered Oct 31 '22 13:10

Rhys