在c#.net中进行验证 [英] validation in c#.net
本文介绍了在c#.net中进行验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在C#.net Windows应用程序中,我希望验证文本框仅接受日期,而其他验证仅接受整数....所以请帮助我...向我发送上面的验证代码....请...
I want validate textbox to accept date only and other validate to accept integers only...in C#.net windows application..so please help me...send me above validation code....please...
推荐答案
我认为更好的解决方案是 ^ ].
I think the better solution is DateTimePicker[^].
如果您只想编辑日期,请不要使用.而是使用 MaskedTextBox
或更好的Calendar控件之一(在标记要使用的UI库之前,我无法更准确地告诉您什么).
-SA
If you want to edit just date, don''t useTextBox
. Instead, useMaskedTextBox
or even better, one of the Calendar controls (I cannot tell more exactly what before you tag what UI library you want to use).
—SA
使用MaskedTextBox
控件(不是普通的TextBox
),可以在工具箱中找到它,然后使用mask属性并从中选择日期.
保重.
UseMaskedTextBox
control not ordinaryTextBox
you can find it in the Toolbox, then use mask property and chose date from it.
Take care.
这篇关于在c#.net中进行验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文