RepeatButton Class
Updated: February 2009
Represents a control that raises its Click event repeatedly from the time it is pressed until it is released.
Assembly: PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
Content Model: RepeatButton is a ContentControl. Its content property is Content. For more information on the content model for RepeatButton, see Controls Content Model Overview.
The RepeatButton class represents a control that is similar to a Button. However, repeat buttons give you control over when and how the Click event occurs. The RepeatButton raises the Click event repeatedly from the time it is pressed until it is released. The Delay property determines when the event begins. You can also control the interval of the repetitions with the Interval property.
Dependency properties for this control might be set by the control’s default style. If a property is set by a default style, the property might change from its default value when the control appears in the application. The default style is determined by which desktop theme is used when the application is running. For more information, see Themes.
The following example shows how to create a RepeatButton.
<RepeatButton Width="100" DockPanel.Dock="Top" Delay="500" Interval="100" Click="Increase"> Increase </RepeatButton> <TextBlock Name="valueText" Width="100" DockPanel.Dock="Top" TextAlignment="Center" FontSize="16"> 0 </TextBlock> <RepeatButton Width="100" DockPanel.Dock="Top" Delay="500" Interval="100" Click="Decrease"> Decrease </RepeatButton>
Private Sub Increase(ByVal sender As Object, ByVal e As RoutedEventArgs) Num = CInt(valueText.Text) valueText.Text = ((Num + 1).ToString()) End Sub Private Sub Decrease(ByVal sender As Object, ByVal e As RoutedEventArgs) Num = CInt(valueText.Text) valueText.Text = ((Num - 1).ToString()) End Sub
System.Windows.Threading.DispatcherObject
System.Windows.DependencyObject
System.Windows.Media.Visual
System.Windows.UIElement
System.Windows.FrameworkElement
System.Windows.Controls.Control
System.Windows.Controls.ContentControl
System.Windows.Controls.Primitives.ButtonBase
System.Windows.Controls.Primitives.RepeatButton
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.