NumericUpDownAcceleration NumericUpDownAcceleration NumericUpDownAcceleration NumericUpDownAcceleration Class

定义

提供信息,指定当按下上移按钮或下移按钮持续指定的时间后应如何对数字显示框(也称为 up-down 控件)执行加速。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
继承
NumericUpDownAccelerationNumericUpDownAccelerationNumericUpDownAccelerationNumericUpDownAcceleration

示例

下面的代码示例演示如何使用NumericUpDownAcceleration类。The following code example demonstrates how to use the NumericUpDownAcceleration class. 若要运行此示例,请将以下代码粘贴到窗体并调用InitializeAcceleratedUpDown方法从窗体的构造函数或Load事件处理程序。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
 

注解

NumericUpDownAcceleration对象由NumericUpDown控件来控制通过大量的数字 (可选) 提供加速时递增或递减。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.

构造函数

NumericUpDownAcceleration(Int32, Decimal) NumericUpDownAcceleration(Int32, Decimal) NumericUpDownAcceleration(Int32, Decimal) NumericUpDownAcceleration(Int32, Decimal)

初始化 NumericUpDownAcceleration 类的新实例。Initializes a new instance of the NumericUpDownAcceleration class.

属性

Increment Increment Increment Increment

获取或设置要在加速过程中递增或递减显示值的量。Gets or sets the quantity to increment or decrement the displayed value during acceleration.

Seconds Seconds Seconds Seconds

获取或设置在加速开始前必须按下上移按钮或下移按钮的秒数。Gets or sets the number of seconds the up or down button must be pressed before the acceleration starts.

方法

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

获取当前实例的 TypeGets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(Inherited from Object)

适用于

另请参阅