In addition to the standard properties shared by all buttons, notice a new
property named Interval. This property determines the time,
in milliseconds, between button click events after the control begins repeating events.
The default value is 33.
To begin the repeat process, use the ButtonClick event instead of Click. To create an event handler for this event, change the filter in the Property Grid to Events and find the entry for ButtonClick. Double-click in the empty value drop-down list for the property to have the designer create a method to handle ButtonClick.
The following code illustrates the use of a RadRepeatButton to manipulate a ProgressBar control. At each interval the ProgressBar value will increment. You do not need to write any additional code to handle the repeating event. As long as the mouse button is pressed down on the RepeatButton control, the code in the ButtonClick event handler will run at each interval.
Copy[C#]
void radRepeatButton1_Click(object sender, EventArgs e)
{
if (radProgressBar1.Value1 < radProgressBar1.Maximum)
{
radProgressBar1.Value1++;
}
else
{
radProgressBar1.Value1 = radProgressBar1.Minimum;
}
}
Copy[VB.NET]
Private Sub radRepeatButton1_Click(ByVal sender As Object, ByVal e As EventArgs)
If radProgressBar1.Value1 < radProgressBar1.Maximum Then
System.Math.Max(System.Threading.Interlocked.Increment(radProgressBar1.Value1), radProgressBar1.Value1 - 1)
Else
radProgressBar1.Value1 = radProgressBar1.Minimum
End If
End Sub