NumericUpDownAcceleration Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Provides information specifying how acceleration should be performed on a spin box (also known as an up-down control) when the up or down button is pressed for specified time period.
public ref class NumericUpDownAcceleration
public class NumericUpDownAcceleration
type NumericUpDownAcceleration = class
Public Class NumericUpDownAcceleration
- Inheritance
-
NumericUpDownAcceleration
Examples
The following code example demonstrates how to use the NumericUpDownAcceleration class. To run this example, paste the following code into a form and call the InitializeAcceleratedUpDown
method from the form's constructor or Load event handler. While the code is running, press and hold the up or down arrow to see the acceleration occur.
private NumericUpDown numericUpDown1;
private void InitializeAcceleratedUpDown()
{
numericUpDown1 = new NumericUpDown();
numericUpDown1.Location = new Point(40, 40);
numericUpDown1.Maximum = 40000;
numericUpDown1.Minimum = -40000;
// Add some accelerations to the control.
numericUpDown1.Accelerations.Add(new NumericUpDownAcceleration(2,100));
numericUpDown1.Accelerations.Add(new NumericUpDownAcceleration(5, 1000));
numericUpDown1.Accelerations.Add(new NumericUpDownAcceleration(8, 5000));
Controls.Add(numericUpDown1);
}
Private numericUpDown1 As NumericUpDown
Private Sub InitializeAcceleratedUpDown()
numericUpDown1 = New NumericUpDown()
numericUpDown1.Location = New Point(40, 40)
numericUpDown1.Maximum = 40000
numericUpDown1.Minimum = - 40000
' Add some accelerations to the control.
numericUpDown1.Accelerations.Add(New NumericUpDownAcceleration(2, 100))
numericUpDown1.Accelerations.Add(New NumericUpDownAcceleration(5, 1000))
numericUpDown1.Accelerations.Add(New NumericUpDownAcceleration(8, 5000))
Controls.Add(numericUpDown1)
End Sub
Remarks
The NumericUpDownAcceleration object is used by the NumericUpDown control to optionally provide acceleration when incrementing or decrementing the control through a large quantity of numbers.
Constructors
NumericUpDownAcceleration(Int32, Decimal) |
Initializes a new instance of the NumericUpDownAcceleration class. |
Properties
Increment |
Gets or sets the quantity to increment or decrement the displayed value during acceleration. |
Seconds |
Gets or sets the number of seconds the up or down button must be pressed before the acceleration starts. |
Methods
Equals(Object) |
Determines whether the specified object is equal to the current object. (Inherited from Object) |
GetHashCode() |
Serves as the default hash function. (Inherited from Object) |
GetType() |
Gets the Type of the current instance. (Inherited from Object) |
MemberwiseClone() |
Creates a shallow copy of the current Object. (Inherited from Object) |
ToString() |
Returns a string that represents the current object. (Inherited from Object) |