Version

AutoRepeat Property

Gets/sets if the click event will continue to fire as the mouse is held down over the button.
Syntax
'Declaration
 
Public Property AutoRepeat As Boolean
public bool AutoRepeat {get; set;}
Remarks

When AutoRepeat is set to true, the click event will be invoked when the SPACE key is first pressed or when the button is first pushed down. It will then wait for the delay specified by the AutoRepeatDelay before entering an auto-repeat mode. While in this mode, until the mouse button is released or the SPACE key is released, the System.Windows.Forms.Control.Click event will be invoked after the AutoRepeatInterval has elasped.

Note When set to false, which is the default value, the click event will only occur when the button is released (by either releasing the mouse button that pressed the button or releasing the SPACE or ENTER key).

Example
The following sample demonstrates how to initialize the autorepeat settings.

Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.Misc

Private Sub InitializeAutoRepeat(ByVal button As Infragistics.Win.Misc.UltraButton)
    ' the Auto-Repeat functionality will cause
    ' the button to click as soon as the mouse presses
    ' the button down. then after 500ms, it will enter 
    ' auto repeat mode and fire the Click event
    ' every 200ms.
    button.AutoRepeatDelay = 500
    button.AutoRepeatInterval = 200
    button.AutoRepeat = True
End Sub

Private Sub ultraButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
    System.Diagnostics.Debug.WriteLine("Click:" + DateTime.Now.ToString("hh:mm:ss:ffffff"))
End Sub
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.Misc;

private void InitializeAutoRepeat(Infragistics.Win.Misc.UltraButton button)
{
	// the Auto-Repeat functionality will cause
	// the button to click as soon as the mouse presses
	// the button down. then after 500ms, it will enter 
	// auto repeat mode and fire the Click event
	// every 200ms.
	button.AutoRepeatDelay = 500;
	button.AutoRepeatInterval = 200;
	button.AutoRepeat = true;
}

private void ultraButton1_Click(object sender, System.EventArgs e)
{
	System.Diagnostics.Debug.WriteLine("Click:" + DateTime.Now.ToString("hh:mm:ss:ffffff"));
}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also