-2

当我单击按钮时,如何在一个文本框中拆分两个单词并将第一个单词放在文本框 1 中,将第二个单词放在文本框 2 中?

4

1 回答 1

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
于 2012-12-10T14:35:21.997 回答