是否可以使用MaskedTextBox来获取特定格式? [英] Is it possible to use MaskedTextBox to get a particular format?

查看:59
本文介绍了是否可以使用MaskedTextBox来获取特定格式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我需要一个文本框控件,可以接受以下格式输入:2 w 3 d 5 h 6 m。用户应该能够在d,w,h和m之前编辑值(表示周,日,小时,分钟)。是否可以使用MaskedTextBox来实现相同的目标。 w,d,h和m不应该是可编辑的。



谢谢,

Divya

Hi,

I require a textbox control that would accept input in the form : 2 w 3 d 5 h 6 m. User should be able to edit the values before d, w, h and m ( which represents weeks, days, hours, minutes). Is it possible to use MaskedTextBox to achieve the same. w,d,h and m should not be editable.

Thanks,
Divya

推荐答案

您可以通过实现 MaskedTextProvider 来实现此目的。

查看如何实现它的示例此处
You can accomplish this by implementing a MaskedTextProvider.
See an example of how to implement it here.


您可以使用CSS类来实现它。创建一个CSS类并在document.ready中使用query创建一个函数(。cssclassname)。functio {编写正则表达式以验证在任何已添加此类的输入文本框中给出的输入}。

由于查询可以使用Id或CSS类名访问任何控件。如果需要更多说明,请告诉我





谢谢和问候

Murtuza
You can implement it by using CSS class. Create a CSS class and in document.ready create a function using query(".cssclassname").functio{ write the regular expression to validate the input given in any input text box which ever has added this class}.
As query can access any control using either Id or a CSS class name. Please let me know if need more clarification


Thanks and regards
Murtuza


这篇关于是否可以使用MaskedTextBox来获取特定格式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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