文本框的wpf验证 [英] wpf validation for textbox

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

问题描述

嗨我想要wpf验证,比如

文本框(包含字符和数字&以字母开头)

文本框(仅限数字)

i don没有权限打开所有网站请发布代码

谢谢

解决方案

没有人会为你发布任何代码。



仔细阅读这些文章并尝试自己实现验证逻辑。



WPF验证 [ ^ ]

Windows Presentation Foundation中的验证 [ ^ ]

http://wpftutorial.net/DataValidation.html [ ^ ]


参考:

WPF中的正则表达式验证 [ ^ ]

WPF中的数据验证 [ ^ ]



类似质量保证:

WPF TextBox验证 [ ^ ]

验证文本框WPF [ ^ ]

WPF TextBox验证 [ ^ ]


< blockquote>

  int  a; 
if (!int.TryParse(yourtextbox.Text, out a))
{
error go here
}
else
{
yourtextbox.text = a;
}


hi i want wpf validation like
Textbox (Include Char and Numbers & Starts with Char)
Textbox(only numbers)
i don't have permissions to open all site pls post the code
thank you

解决方案

No one is going to post any code for you.

Go through each of these articles and try implementing validation logic on your own.

WPF Validation[^]
Validation in Windows Presentation Foundation[^]
http://wpftutorial.net/DataValidation.html[^]


Refer:
Regex Validation in WPF[^]
Data Validation in WPF[^]

Similar QA:
WPF TextBox Validation[^]
Validation textbox WPF[^]
WPF TextBox Validation [^]


 int a;
 if(!int.TryParse(yourtextbox.Text,out a))
{
   error go here
}
else
{
  yourtextbox.text=a;
}


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

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