{"id":635,"date":"2016-10-17T13:57:34","date_gmt":"2016-10-17T02:57:34","guid":{"rendered":"http:\/\/www.nickdu.com\/?p=635"},"modified":"2016-10-17T13:57:34","modified_gmt":"2016-10-17T02:57:34","slug":"iptextbox-in-c","status":"publish","type":"post","link":"https:\/\/nickdu.com\/?p=635","title":{"rendered":"C# UserControl IPTextBox"},"content":{"rendered":"<p>I am looking for a TextBox control, which can validate and filter out IP Address. After a bit research, I come with this <a href=\"https:\/\/social.msdn.microsoft.com\/Forums\/vstudio\/en-US\/4c2aefae-ca6a-4e71-8564-fe73da7107f1\/maskedtextbox-formatting-for-an-ip-address?forum=csharpgeneral\">https:\/\/social.msdn.microsoft.com\/Forums\/vstudio\/en-US\/4c2aefae-ca6a-4e71-8564-fe73da7107f1\/maskedtextbox-formatting-for-an-ip-address?forum=csharpgeneral<\/a>. It&#8217;s easy to implement and simple to use. Just like normal TextBox.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-642\" src=\"http:\/\/www.nickdu.com\/wp-content\/uploads\/2016\/10\/IPTextBox.jpg\" alt=\"iptextbox\" width=\"235\" height=\"125\" \/><\/p>\n<pre lang=\"CSharp\">using System.Windows.Forms;\nclass IPTextBox : TextBox\n{\n    public IPTextBox() : base()\n    {\n        SetStyle(ControlStyles.ResizeRedraw, true);\n    }\n\n    protected override CreateParams CreateParams\n    {\n        get\n        {\n            var cp = base.CreateParams;\n            cp.ClassName = \"SysIPAddress32\";\n            return cp;\n        }\n    }\n}\n<\/pre>\n<p>Another complete solution can be found <a href=\"http:\/\/www.sanity-free.org\/127\/an_ipaddress_control_the_win32_sysipaddress32_control_in_csharp.html\">http:\/\/www.sanity-free.org\/127\/an_ipaddress_control_the_win32_sysipaddress32_control_in_csharp.html<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I am looking for a TextBox control, which can validate and filter out IP Address. After a bit research, I come with this https:\/\/social.msdn.microsoft.com\/Forums\/vstudio\/en-US\/4c2aefae-ca6a-4e71-8564-fe73da7107f1\/maskedtextbox-formatting-for-an-ip-address?forum=csharpgeneral. It&#8217;s easy to implement and simple to use. Just like normal TextBox. using System.Windows.Forms; class IPTextBox : TextBox { public IPTextBox() : base() { SetStyle(ControlStyles.ResizeRedraw, true); } protected override CreateParams CreateParams &hellip; <a href=\"https:\/\/nickdu.com\/?p=635\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;C# UserControl IPTextBox&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,2],"tags":[],"class_list":["post-635","post","type-post","status-publish","format-standard","hentry","category-net","category-it"],"_links":{"self":[{"href":"https:\/\/nickdu.com\/index.php?rest_route=\/wp\/v2\/posts\/635","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nickdu.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nickdu.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nickdu.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nickdu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=635"}],"version-history":[{"count":0,"href":"https:\/\/nickdu.com\/index.php?rest_route=\/wp\/v2\/posts\/635\/revisions"}],"wp:attachment":[{"href":"https:\/\/nickdu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=635"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nickdu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=635"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nickdu.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=635"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}