MaskedTextBox [英] MaskedTextBox

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

问题描述


我有这个面具蒙版的MaskedTextBox:.../.../...

我在这个面具中的文字总和如何?
:(

Hi
I have MaskedTextBox whith this mask: .../.../...

How I was sum text in this mask?
:(

推荐答案

Hello Raheleh,

由于您的问题不是很清楚(正如OriginalGriff曾经评论过的那样),我将通过尝试您的面具来发布我发现的内容:

此掩码不允许任何输入,因为掩码中的小数点仅是您当前区域性中小数点分隔符所在字符的占位符,而"/"是您当前区域性中任何日期分隔符的占位符.如果要从其特殊字符中转出掩码字符,则必须在其前面加上\.

如果您要输入数字,请使用类似以下内容的内容:
#0.00 \/#0.00 \/#0.00

这样,您最多可以输入两位数字,带两个小数位,其中从0到9的数字不必以零开头,但是必须输入两个小数位.这些数字似乎用正斜杠分隔:

http://msdn.microsoft.com /en-us/library/system.windows.forms.maskedtextbox.mask(v=VS.80).aspx


最好的问候

曼弗雷德(Manfred)
Hello Raheleh,

since your question is not very clear (as OriginalGriff already commented on) I''ll just post what I found out by trying out your mask:

This mask won''t allow for any input since the decimal point in a mask is just a placeholder for whatever character the decimal seperator is in your current Culture and the "/" is the placeholder for whatever the date separator is in you current Culture. If you want to escape a mask character from it''s special meaning you''ll have to put a \ in front of it.

If you''re looking to input numbers use something in the likes of:
#0.00\/#0.00\/#0.00

This will allow you to enter up to two digit numbers with two decimal places where numbers from zero to nine won''t have to be prefixed with a zero, but both decimal places have to be entered. The numbers will appear to be separated by a forward slash:

http://msdn.microsoft.com/en-us/library/system.windows.forms.maskedtextbox.mask(v=VS.80).aspx


Best Regards

Manfred


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

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