Repeat buttons are represented by the NRepeatButton class, which is derived from NButtonBase. When pressed, the repeat button raises its Click event repeatedly at user specified intervals of time.
Besides the Click event, which is inherited from the NButtonBase class, the repeat button offers 2 more events:
The following example demonstrates how to create a repeat button and handle its events:
Repeat Button Events |
Copy Code
|
---|---|
... NRepeatButton repeatButton = new NRepeatButton("Repeat button"); repeatButton.StartClicking += new Function<NEventArgs>(OnRepeatButtonStartClicking); repeatButton.Click += new Function<NEventArgs>(OnButtonClicked); repeatButton.EndClicking += new Function<NEventArgs>(OnRepeatButtonEndClicking); ... void OnButtonClicked(NEventArgs arg1) { Console.WriteLine("Button clicked"); } void OnRepeatButtonStartClicking(NEventArgs arg1) { Console.WriteLine("Button start repeated clicking"); } void OnRepeatButtonEndClicking(NEventArgs arg1) { Console.WriteLine("Button end repeated clicking"); } |