如何在单个文本框中拆分两个单词,并在单击按钮时将第一个单词放在文本框1中,将第二个单词放在文本框2中?
答案 0 :(得分:2)
喜欢这个吗?
Private Sub SomeButton_Click(sender As System.Object, e As System.EventArgs) Handles SomeButton.Click
Dim words = txt1.Text.Split()
txt2.Text = words(0).Trim()
If words.Length <> 1
txt3.Text = words(1).Trim()
End If
End Sub