如何使NumericUpDown只读 [英] How to make NumericUpDown ReadOnly

查看:143
本文介绍了如何使NumericUpDown只读的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使WinForms NumericUpDown控件不可编辑,或者至少应该禁用旋转控件.我尝试将控件设置为只读,但是使用鼠标滚动值正在更改.请帮助我实现这一目标.

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.

推荐答案

尝试以下操作,以将数字上/下设置为只读:

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

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

希望对您有帮助.

这篇关于如何使NumericUpDown只读的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆