使用textbox1和textbox2的逐行数据更新textbox3 [英] Updating textbox3 with line by line data of textbox1 and textbox2
问题描述
Hi Friends
我的程序中有三个文本框
我该如何更新我的textbox3数据
Hi Friends
i have three textbox in my program
How do i update my textbox3 Data like this
<pre>
Rich_textbox3第1行= textbox1_line1 + textbox2_line1
Rich_textbox3第2行= textbox1_line2 + textbox2_line1
Rich_textbox3第3行= textbox1_line3 + textbox2_line1
Rich_textbox3第4行= textbox1_line4 + textbox2_line1
Rich_textbox3第5行= textbox1_line5 + textbox2_line1
它将继续到textbox1的最后一行
感谢
Rich_textbox3 line1 = textbox1_line1 + textbox2_line1
Rich_textbox3 line2 = textbox1_line2 + textbox2_line1
Rich_textbox3 line3 = textbox1_line3 + textbox2_line1
Rich_textbox3 line4 = textbox1_line4 + textbox2_line1
Rich_textbox3 line5 = textbox1_line5 + textbox2_line1
it will continue to last line of textbox1
Thanks
推荐答案
TextBox
具有Lines
属性,该属性为您提供文本框各行的字符串数组.您将需要这个和一个for
循环.
创建另一个字符串数组,其长度与第一个文本框的Lines
相同;然后遍历第一个文本框Lines
中的每个字符串,并将第二个文本框中的行附加到该字符串.将串联的字符串存储在重复的字符串数组中的适当位置.完成对第一个文本框中的所有行的迭代之后,将串联的字符串数组分配给第三个文本框的Lines
属性.
TextBox
s have aLines
property which gives you a string array of the lines of the text box. You''ll need this and afor
loop.
Create another string array the same length as the first text box''sLines
; then iterate over each string in the first text box''sLines
and append the line from the second box to it. Store the concatenated string in the appropriate position in your duplicate string array. When you have finished iterating over all of the lines in the first text box, assign the concatenated string array to the third text box''sLines
property.
这篇关于使用textbox1和textbox2的逐行数据更新textbox3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!