Search code examples
winformsreadonlymousewheelnumericupdown

How to make NumericUpDown ReadOnly


I would like to make WinForms NumericUpDown control non-editable or at least spin control should be disabled. I tried setting the control readonly but using mouse scroll values are changing. Please help me to achieve this.


Solution

  • Try the following in order to set the numeric up/down as read-only:

    numericUpDown1.ReadOnly = true;    
    numericUpDown1.Increment = 0;
    

    I hope it helps.