Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change cursor to hand when I hover over a button

I want to change the cursor to hand when hovering over a button, for example, I have this button :

<Button Content="" HorizontalAlignment="Left" Margin="229,128,0,0" VerticalAlignment="Top" Height="107" Width="170" Grid.RowSpan="2">
     <Button.Template>
         <ControlTemplate TargetType="Button">
             <Grid>
                 <Grid.Background>
                     <ImageBrush ImageSource="africa/picture17.png"/>
                 </Grid.Background>
                 <ContentPresenter/>
             </Grid>
         </ControlTemplate>
     </Button.Template>
</Button>

How to change the cursor to hand when I hover over the button? I'm using Visual Studio 2013 for Windows Store 8 and C#-XAML.

like image 761
Lamawy Avatar asked Apr 16 '14 18:04

Lamawy


People also ask

How do you change the cursor into a hand when a user hovers over a list item?

How to make the cursor to hand when a user hovers over a list item using CSS? Use CSS property to create cursor to hand when user hovers over the list of items. First create list of items using HTML <ul> and <li> tag and then use CSS property :hover to cursor:grab; to make cursor to hand hover the list of items.

What is the hand cursor called?

It is also called a pointer, but today pointer refer to a specific cursor, the one that looks like a hand with an extended index finger.


Video Answer


2 Answers

You can do this by changing the Cursor property:

<Button Cursor="Hand" .../>
like image 79
gleng Avatar answered Oct 17 '22 00:10

gleng


You need to use Style for buttons, could you write in window resource or in button's style:

<Style>
  <Style.Triggers>
    <Trigger Property="IsMouseOver" Value="True">
      <Setter Property="Cursor" Value="Hand"/>
    </Trigger>
  </Style.Triggers>
</Style>
like image 20
yosef_maj Avatar answered Oct 17 '22 01:10

yosef_maj