WPF中的IP地址的文本框验证

问题描述:

我正在使用C#WPF应用程序。我希望把对整数验证(0123456789和。)仅..文本框应该包含一个IP地址...所以需要确保以正确的IP地址该用户的关键,他们点击提交前按钮...我怎么能实现呢?

I'm making a WPF Application using C#. I want to put validations on integers (0123456789 and ".") only.. The textbox is supposed to contain an IP address... So need to ensure that user key in their correct "IP Address" before they click on the "Submit" button... How can I achieve it?

感谢。

您可以轻松实现这使用WPF绑定验证规则或使用自定义屏蔽文本框

You can easily implement this using Wpf binding validation rules or by using a custom masked textbox

检查这些链接为您正在寻找什么

Check these links for exactly what you are looking for

的http:/ /geekswithblogs.net/QuandaryPhase/archive/2008/12/17/wpf-masked-textbox.aspx

http://www.switchonthecode.com/tutorials/wpf-tutorial-binding-validation-rules

希望它可以帮助..