.net屏蔽的文本框 [英] .net Masked Text Box

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

问题描述

在WinForms应用程序(VB.net)中,"百分比"的掩码是什么?

What is the mask for "percentage", in a WinForms application (VB.net)?

推荐答案

根据此处的文档:

\转义.转义掩码字符, 将其转化为文字. "\\"是 反斜杠的转义序列.

\ Escape. Escapes a mask character, turning it into a literal. "\\" is the escape sequence for a backslash.

因此,%符号的掩码为\%

So the mask for a % sign is \%

发布之前,我制作了一个快速且肮脏的winforms应用程序,对其进行了尝试并成功运行.

Before posting, I made up a quick and dirty winforms app, tried it and it works.

编辑-已添加,尽管文档中的下一项使它看起来像是直接的%符号也可以在没有反斜杠的情况下工作,所以我尝试了一下,并且效果也很好.

Edit - added although this next item in the documentation makes it look like just a straight % sign should work without the backslash, so I tried it and it works as well.

所有其他字符文字.全部 非遮罩元素将显示为 自己在MaskedTextBox中. 文字总是占据静态的 在运行时将其放置在面罩中,以及 不能被移动或删除 用户.

All other characters Literals. All non-mask elements will appear as themselves within MaskedTextBox. Literals always occupy a static position in the mask at run time, and cannot be moved or deleted by the user.

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

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