Infragistics(R) NetAdvantage(R) Windows Forms
AutoRepeat Property
See Also  Example E-mail your feedback on this topic.
Infragistics.Win.Misc Namespace > UltraButton Class : AutoRepeat Property

Gets/sets if the click event will continue to fire as the mouse is held down over the button.

Syntax

Visual Basic (Declaration) 
Public Property AutoRepeat As Boolean
C# 
public bool AutoRepeat {get; set;}

Example

The following sample demonstrates how to initialize the autorepeat settings.

Visual BasicCopy Code
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
C#Copy Code
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"));
}

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).

See Also