Class RadRepeatButtonElement
Represents a button element that generates repeated click events when held down continuously. This class extends RadButtonElement to provide automatic click repetition functionality with configurable delay and interval timing. Like all elements, it can be nested in other Telerik controls. The RadRepeatButton class serves as a wrapper for this element, transferring events between the control and element instances. All UI rendering and logical functionality is implemented in this class.
Inheritance
Inherited Members
Namespace: Telerik.WinControls.UI
Assembly: Telerik.WinControls.UI.dll
Syntax
public class RadRepeatButtonElement : RadButtonElement, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IComponent, IDisposable, IBindableComponent, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode, IButtonControl, IImageElement
Constructors
RadRepeatButtonElement()
Initializes a new instance of the RadRepeatButtonElement class. Creates a repeat button element with default settings and no initial text.
Declaration
public RadRepeatButtonElement()
RadRepeatButtonElement(String)
Initializes a new instance of the RadRepeatButtonElement class with the specified text. Creates a repeat button element with the provided text content and default repeat settings.
Declaration
public RadRepeatButtonElement(string text)
Parameters
System.String
text
The text to display on the repeat button element. |
Fields
DelayProperty
Identifies the Delay dependency property. This property defines the initial delay in milliseconds before repeat clicking begins when the button is held down. The default value is derived from system keyboard delay settings.
Declaration
public static readonly RadProperty DelayProperty
Field Value
RadProperty
|
IntervalProperty
Identifies the Interval dependency property. This property defines the interval in milliseconds between repeated clicks after the initial delay has elapsed. The default value is derived from system keyboard speed settings.
Declaration
public static readonly RadProperty IntervalProperty
Field Value
RadProperty
|
Properties
Delay
Gets or sets the amount of time, in milliseconds, the repeat button element waits while it is pressed before it starts repeating. This initial delay prevents accidental repeat operations from brief button presses. The value must be non-negative.
Declaration
[RadPropertyDefaultValue("Delay", typeof(RadRepeatButtonElement))]
public int Delay { get; set; }
Property Value
System.Int32
The delay in milliseconds before repeating starts. Must be non-negative. Default value is derived from system keyboard delay settings. |
Interval
Gets or sets the amount of time, in milliseconds, between repeats once repeating starts. This interval controls the speed of repeated clicks after the initial delay period has elapsed. The value must be greater than zero.
Declaration
[RadPropertyDefaultValue("Interval", typeof(RadRepeatButtonElement))]
public int Interval { get; set; }
Property Value
System.Int32
The interval in milliseconds between repeated clicks. Must be greater than zero. Default value is derived from system keyboard speed settings. |
Methods
DisposeManagedResources()
Releases the managed resources used by the RadRepeatButtonElement. This method properly disposes of the internal timer to prevent resource leaks and calls the base disposal method.
Declaration
protected override void DisposeManagedResources()
Overrides
OnClick(EventArgs)
Handles the click event for the repeat button element. This method calls the base implementation and notifies the parent RadRepeatButton control to perform its button click operation, enabling the repeat functionality to propagate to the control level.
Declaration
protected override void OnClick(EventArgs e)
Parameters
System.EventArgs
e
An System.EventArgs that contains the event data. |
Overrides
OnDoubleClick(EventArgs)
Handles the double-click event for the repeat button element. This method only processes the double-click if double-clicking is enabled for the button, calling the base implementation to maintain standard double-click behavior.
Declaration
protected override void OnDoubleClick(EventArgs e)
Parameters
System.EventArgs
e
An System.EventArgs that contains the event data. |
Overrides
OnEnabledChanged(RadPropertyChangedEventArgs)
Handles the enabled state change event for the repeat button element. This method calls the base implementation, resets the pressed state to false when disabled, and stops the repeat timer to prevent further click generation.
Declaration
protected override void OnEnabledChanged(RadPropertyChangedEventArgs e)
Parameters
RadPropertyChangedEventArgs
e
A RadPropertyChangedEventArgs that contains the event data. |
Overrides
OnMouseDown(MouseEventArgs)
Handles the mouse down event for the repeat button element. This method calls the base implementation and starts the repeat timer when the left mouse button is pressed, unless the button is configured for hover click mode.
Declaration
protected override void OnMouseDown(MouseEventArgs e)
Parameters
System.Windows.Forms.MouseEventArgs
e
A System.Windows.Forms.MouseEventArgs that contains the event data. |
Overrides
OnMouseEnter(EventArgs)
Handles the mouse enter event for the repeat button element. This method calls the base implementation, processes mouse-over state changes for hover click mode, and starts the repeat timer if the button is already pressed when the mouse enters.
Declaration
protected override void OnMouseEnter(EventArgs e)
Parameters
System.EventArgs
e
An System.EventArgs that contains the event data. |
Overrides
OnMouseLeave(EventArgs)
Handles the mouse leave event for the repeat button element. This method calls the base implementation and processes mouse-over state changes, which may stop the timer if the button is configured for hover click mode.
Declaration
protected override void OnMouseLeave(EventArgs e)
Parameters
System.EventArgs
e
An System.EventArgs that contains the event data. |
Overrides
OnMouseUp(MouseEventArgs)
Handles the mouse up event for the repeat button element. This method calls the base implementation and stops the repeat timer when the left mouse button is released, unless the button is configured for hover click mode.
Declaration
protected override void OnMouseUp(MouseEventArgs e)
Parameters
System.Windows.Forms.MouseEventArgs
e
A System.Windows.Forms.MouseEventArgs that contains the event data. |
Overrides
OnTimeout(Object, EventArgs)
Handles the timer timeout event that triggers repeated button clicks. This method adjusts the timer interval to the configured repeat interval and generates click events while the button remains pressed, respecting the current click mode and mouse button state.
Declaration
protected virtual void OnTimeout(object sender, EventArgs e)
Parameters
System.Object
sender
The timer that raised the event. |
System.EventArgs
e
An System.EventArgs that contains the event data. |