使用textbox1和textbox2的逐行数据更新textbox3 [英] Updating textbox3 with line by line data of textbox1 and textbox2

查看:111
本文介绍了使用textbox1和textbox2的逐行数据更新textbox3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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属性.
TextBoxs have a Lines property which gives you a string array of the lines of the text box. You''ll need this and a for loop.

Create another string array the same length as the first text box''s Lines; then iterate over each string in the first text box''s Lines 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''s Lines property.


这篇关于使用textbox1和textbox2的逐行数据更新textbox3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆