在numericUpDown值中添加一个符号(如%) [英] adding a sign to numericUpDown value (like %)
本文介绍了在numericUpDown值中添加一个符号(如%)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试将%"符号添加到我的numericUpDown中,该符号为readonly = false. 因此,例如5%.
I am trying to add "%" sign to my numericUpDown that is readonly=false. So it's like 5% for example.
这可能吗?
谢谢
推荐答案
如果需要不同的输出",我们需要编写自己的控件并使用它.
We need to write own control and use it if we want different "output".
public class MyNumericUpDown : NumericUpDown
{
protected override void UpdateEditText()
{
base.UpdateEditText();
ChangingText = true;
Text += "%";
}
}
@Kenji
如果仅设置Text
属性,则会丢失某些功能(例如,十六进制或DecimalPlaces)
@Kenji
If we only set Text
property we lose some functionality (eg. Hexadecimal or DecimalPlaces)
这篇关于在numericUpDown值中添加一个符号(如%)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文