开发者

.net Masked Text Box

开发者 https://www.devze.com 2023-01-06 00:33 出处:网络
What is the mask for \"percentage开发者_如何转开发\", in a WinForms application (VB.net)? Per the documentation here: http://msdn.microsoft.com/en-us/library/system.windows.forms.maskedtextbox.mask.as

What is the mask for "percentage开发者_如何转开发", in a WinForms application (VB.net)?


Per the documentation here: http://msdn.microsoft.com/en-us/library/system.windows.forms.maskedtextbox.mask.aspx

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

So the mask for a % sign is \%

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.

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.


textEdit1.Properties.Mask.MaskType = Numeric;
textEdit1.Properties.Mask.EditMask = "00.00%%";
textEdit1.Properties.Mask.UseMaskAsDisplayFormat = true;

http://community.devexpress.com/forums/t/59535.aspx

0

精彩评论

暂无评论...
验证码 换一张
取 消