{"id":1137,"date":"2019-11-05T12:16:30","date_gmt":"2019-11-05T04:16:30","guid":{"rendered":"http:\/\/iqotom.com\/?p=1137"},"modified":"2019-11-05T12:16:32","modified_gmt":"2019-11-05T04:16:32","slug":"wpf%e4%b8%80%e6%ac%a1%e8%8e%b7%e5%8f%96%e5%a4%9a%e4%b8%aatextbox%e6%8e%a7%e4%bb%b6","status":"publish","type":"post","link":"http:\/\/iqotom.com\/?p=1137","title":{"rendered":"WPF\u4e00\u6b21\u83b7\u53d6\u591a\u4e2aTextBox\u63a7\u4ef6"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<p><strong>1\u3001\u5c06\u6240\u8981\u83b7\u53d6\u7684textBox\u63a7\u4ef6\uff0c\u7528\u4e00\u4e2aGrid\u5305\u542b\u8d77\u6765\uff0c\u4f8b\u5982\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;Grid Name=\"grid\">\n    &lt;TextBox Name=\"text1\" Text=\"0\" \/>\n    &lt;TextBox Name=\"text2\" Text=\"1\" \/>\n    &lt;TextBox Name=\"text3\" Text=\"2\" \/>\n    &lt;TextBox Name=\"text4\" Text=\"3\" \/>\n&lt;\/Grid> <\/code><\/pre>\n\n\n\n<p><strong>2\u3001\u904d\u5386\u6240\u6709TextBox\u63a7\u4ef6\uff0c\u5e76\u62fc\u63a5\u6240\u6709text<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>private String GetAllValueStr()\n        {\n            StringBuilder sb = new StringBuilder(8);\n            foreach (UIElement control in grid.Children)\n            {\n                if (control is TextBox)\n                {\n                    TextBox textBox = control as TextBox;\n                    sb.Append(textBox.Text);\n                }\n            }\n            return sb.ToString();\n        }<\/code><\/pre>\n\n\n\n<p>\u53ef\u4ee5\u7ed9\u6240\u6709\u7684TextBox \u8bbe\u7f6e\u540c\u4e00\u4e2aTextChanged\u4e8b\u4ef6\uff0c\u8fd9\u6837\u6539\u53d8\u4e00\u4e2aTextBox\u4e5f\u53ef\u4ee5\u83b7\u53d6\u5230\u6240\u6709\u7684TextBox\u503c<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1\u3001\u5c06\u6240\u8981\u83b7\u53d6\u7684textBox\u63a7\u4ef6\uff0c\u7528\u4e00\u4e2aGrid\u5305\u542b\u8d77\u6765\uff0c\u4f8b\u5982\uff1a 2\u3001\u904d\u5386\u6240\u6709TextBox\u63a7\u4ef6\uff0c\u5e76\u62fc\u63a5\u6240\u6709\u2026 <span class=\"read-more\"><a href=\"http:\/\/iqotom.com\/?p=1137\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":1140,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[56],"tags":[57,90],"_links":{"self":[{"href":"http:\/\/iqotom.com\/index.php?rest_route=\/wp\/v2\/posts\/1137"}],"collection":[{"href":"http:\/\/iqotom.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/iqotom.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/iqotom.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/iqotom.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1137"}],"version-history":[{"count":1,"href":"http:\/\/iqotom.com\/index.php?rest_route=\/wp\/v2\/posts\/1137\/revisions"}],"predecessor-version":[{"id":1138,"href":"http:\/\/iqotom.com\/index.php?rest_route=\/wp\/v2\/posts\/1137\/revisions\/1138"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/iqotom.com\/index.php?rest_route=\/wp\/v2\/media\/1140"}],"wp:attachment":[{"href":"http:\/\/iqotom.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1137"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/iqotom.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1137"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/iqotom.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1137"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}