内容:在textbox1中输入文本 ,textbox2中会同步变化,如参考界面所示。
提示:字符串的连接用&符号;
回车符号为vbcrlf。
参考界面:
![](https://i-blog.csdnimg.cn/blog_migrate/6427183708764830c4bee3f142257097.png)
TextBox2 的MultiLine(多行属性):设置为True
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
TextBox1.Clear() //清空键
TextBox2.Clear()
End Sub
Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged
TextBox2.Text &= TextBox1.Text & vbCrLf //字符串的连接用&符号,回车符号为vbcrlf
End Sub
End Class