{"id":2304,"date":"2022-08-30T15:23:45","date_gmt":"2022-08-30T15:23:45","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/01\/05\/how-to-append-text-to-lines-of-texbox-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:23:45","modified_gmt":"2022-08-30T15:23:45","slug":"how-to-append-text-to-lines-of-texbox-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/how-to-append-text-to-lines-of-texbox-collection-of-common-programming-errors\/","title":{"rendered":"how to append text to lines of texbox?-Collection of common programming errors"},"content":{"rendered":"<p>Setting Lines may trigger the <code>_TextChanged<\/code> event again. What is the error you are getting? If you see a StackOverflowException, this is the cause.<\/p>\n<p>You could possibly add this to get around the problem, or take the bool flag approach Daniel mentioned in his answer.<\/p>\n<pre><code>text.TextChanged -= textBox1_TextChanged;\n\ntext.Lines = currentLines;\n\ntext.TextChanged += textBox1_TextChanged;\n<\/code><\/pre>\n<p>Also, perhaps this question discussing the difference between programmatic changes and user driven changes is of interest to you.<\/p>\n<p id=\"rop\"><small>Originally posted 2014-01-05 10:07:59. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>Setting Lines may trigger the _TextChanged event again. What is the error you are getting? If you see a StackOverflowException, this is the cause. You could possibly add this to get around the problem, or take the bool flag approach Daniel mentioned in his answer. text.TextChanged -= textBox1_TextChanged; text.Lines = currentLines; text.TextChanged += textBox1_TextChanged; Also, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2304","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2304","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=2304"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2304\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=2304"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=2304"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=2304"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}