#662 – IsMouseOver Property
October 5, 2012 3 Comments
Every UIElement object has an IsMouseOver property that indicates whether or not the mouse is currently located over the element.
In the example below, we define a Label whose content is bound to the current state of the IsMouseOver property for a Button.
<StackPanel Margin="20"> <Button Name="btn1" Content="Move Mouse Over Me !" HorizontalAlignment="Center" Padding="10,5"/> <Label Content="{Binding ElementName=btn1, Path=IsMouseOver}" Foreground="Green"/> </StackPanel>
Pingback: Dew Drop – October 5, 2012 (#1,416) | Alvin Ashcraft's Morning Dew
Pingback: #663 – How IsMouseOver Works for Nested Elements « 2,000 Things You Should Know About WPF
Pingback: #664 – MouseEnter and MouseLeave Events « 2,000 Things You Should Know About WPF