Check text box for IP address in WPF

I am making a WPF application using C #. I want to put checks only on integers (0123456789 and "."). The text box should contain an IP address ... Therefore, you need to make sure that the user key in their correct "IP address" before clicking "Submit" "... How can I achieve this?

Thanks.

+4
source share
3 answers

You can easily implement this using Wpf binding validation rules or using a special masked text field

Check out these links exactly for 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

Hope this helps.

+3
source

It looks like you are trying to implement a masked text field, which is a text field that automatically formats the data according to the type of user in accordance with a given template. Check out this guide on how to implement this as it does not appear in the finished WPF: Masked TextBox in WPF

+2
source

The following question link to StackOverflow contains many pointers to the implementation of MaskedTextBox in WPF . You can use it to enter the IP Address from the user.

Where can I find a free text file in a WPF text box?

+2
source

Source: https://habr.com/ru/post/1332723/


All Articles