# Spin Up/Spin Down Programmatically

Learn how to use SpinUp and SpinDown methods.

## Content



The **SpinUp** and **SpinDown** methods enable you to increase or decrease the values entered in the C1Input controls (C1ComboBox, C1DropDownControl, C1DateEdit and C1NumericInput) when the focus is not on the control.

In addition to the above methods, C1ComboBox and C1DateEdit contain an additional property **AllowSpinLoop** that, when set to true, loops through the items when the **SpinUp** or **SpinDown** method is invoked.

Following is an example to use the **SpinUp** method:

1.  Create a new Windows Application project. Place a C1NumericEdit control on the form.
2.  From the **Properties** window, set the **Value** property to 0.
3.  Add a textbox control onto the form and double click the textbox to generate the **TextChanged** event, in code.
4.  Add the following code to the textbox's **TextChanged** event.
    
    DOC-DETAILS-TAG-OPEN
    
    DOC-SUMMARY-TAG-OPEN
    
    To write code in Visual Basic
    
    DOC-SUMMARY-TAG-CLOSE
    
    ```vbnet
    Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged
    ```
    
    DOC-DETAILS-TAG-CLOSE
    
    DOC-DETAILS-TAG-OPEN
    
    DOC-SUMMARY-TAG-OPEN
    
    To write code in C#
    
    DOC-SUMMARY-TAG-CLOSE
    
    ```csharp
    private void textBox1_TextChanged(object sender, EventArgs e){      c1NumericEdit1.SpinUp(1);}
    ```
    
    DOC-DETAILS-TAG-CLOSE
    
5.  Run the project.

### What You've Accomplished

When you enter characters into the textbox control, the value in the C1NumericEdit control will increase by 1, each time a new character is entered, giving you the count of characters entered in the control.

![spinupspindown_numericedit](https://cdn.mescius.io/document-site-files/images/6c2f30e9-4d3a-4f86-b649-ecbef777b3a3/images/spinupspindownprogrammatically.gif)

## See Also

[SpinUp Method](/componentone/api/win/online-input/dotnet-framework-api/C1.Win.C1Input.4.8/C1.Win.C1Input.C1ComboBox.SpinUp.html)

[SpinDown Method](/componentone/api/win/online-input/dotnet-framework-api/C1.Win.C1Input.4.8/C1.Win.C1Input.C1ComboBox.SpinDown.html)

[SpinUp Method](/componentone/api/win/online-input/dotnet-framework-api/C1.Win.C1Input.4.8/C1.Win.C1Input.C1DateEdit.SpinUp.html)

[SpinDown Method](/componentone/api/win/online-input/dotnet-framework-api/C1.Win.C1Input.4.8/C1.Win.C1Input.C1DateEdit.SpinDown.html)

[SpinUp Method](/componentone/api/win/online-input/dotnet-framework-api/C1.Win.C1Input.4.8/C1.Win.C1Input.C1DropDownControl.SpinUp.html)

[SpinDown Method](/componentone/api/win/online-input/dotnet-framework-api/C1.Win.C1Input.4.8/C1.Win.C1Input.C1DropDownControl.SpinDown.html)

[SpinUp Method](/componentone/api/win/online-input/dotnet-framework-api/C1.Win.C1Input.4.8/C1.Win.C1Input.C1NumericEdit.SpinUp.html)

[SpinDown Method](/componentone/api/win/online-input/dotnet-framework-api/C1.Win.C1Input.4.8/C1.Win.C1Input.C1NumericEdit.SpinDown.html)

[AllowSpinLoop Property](/componentone/api/win/online-input/dotnet-framework-api/C1.Win.C1Input.4.8/C1.Win.C1Input.C1ComboBox.AllowSpinLoop.html)

[AllowSpinLoop Property](/componentone/api/win/online-input/dotnet-framework-api/C1.Win.C1Input.4.8/C1.Win.C1Input.C1DateEdit.AllowSpinLoop.html)

[Change Up-Down Button Alignment](/componentone/docs/win/online-input/inputforwinformstask/Changeupdownbuttonalignment)