IP Address in a MaskedTextBox?

Much simpler than the other answers: Use System.Net.IPAddress and System.Windows.Forms.MaskedTextBox set the following properties of the MaskedTextBox: MaskedTextBox.Mask = ###.###.###.### MaskedTextBox.ValidatingType = typeof(System.Net.IPAddress); whenever the text box is validating, event MaskedTextBox.TypeValidationCompleted is raised. The event arguments show the following: Is the typed text acceptable as an IP address? (= does System.Net.IPAddress.TryParse return ok) Description of … Read more