#850 – Specifying a Delay and Interval for a RepeatButton

If you hold the left mouse button down after clicking on a RepeatButton control, it will repeatedly fire Click events.

By default, a RepeatButton waits 1/2 sec (500 ms) after firing the first Click event and then begins firing Click events every 33 ms (about 30 times per second).

You can configure these values using the following properties of the RepeatButton:

  • Delay – Initial delay to wait, after first Click event, before repeatedly firing additional events
  • Interval – Time to wait between Click events

Note that the interval between events includes whatever time is spent in executing the Click event handler, unless you perform any required processing on a background thread.  In other words, the clock begins ticking again towards the next interval after you exit from the Click handler for the previous tick.

Advertisements