IP Address in a MaskedTextBox?

前端 未结 6 1527
無奈伤痛
無奈伤痛 2020-12-03 15:09

How can I use a MaskedTextBox to prevent the user from entering an invalid IP address? (I want it to behave just like the Windows one).

6条回答
  •  情深已故
    2020-12-03 15:22

    I made an IP masked textbox that mimicks the Windows one.

    Has the same width, height, prevents users from entering >255 values, jumps boxes, etc, etc... If you still need it and want to try it out it's here:

    https://github.com/RuvenSalamon/IP-MaskedTextBox

    (I don't know if this counts as self promotion but it's open-source so I reckon it's ok.)

提交回复
热议问题