TextBoxBase.AppendText(String) TextBoxBase.AppendText(String) TextBoxBase.AppendText(String) TextBoxBase.AppendText(String) Method

定义

将字符串追加到文本控件的内容。Appends a string to the contents of a text control.

public:
 void AppendText(System::String ^ textData);
public void AppendText (string textData);
member this.AppendText : string -> unit
Public Sub AppendText (textData As String)

参数

textData
String String String String

指定追加到文本控件的当前内容的文本的字符串。A string that specifies the text to append to the current contents of the text control.

示例

下面的示例演示如何使用 AppendText 方法。The following example demonstrates how to use the AppendText method.

private void tChanged(object sender, RoutedEventArgs e)
{
    myTextBox.AppendText("Text content of myTextBox2 has changed.");
}
Private Sub tChanged(ByVal sender As Object, ByVal e As TextChangedEventArgs)
    myTextBox.AppendText("Text content of myTextBox2 has changed.")
End Sub

注解

AppendText方法使用户能够在不使用文本连接的情况下将文本追加到文本控件的内容, 这在需要多个串联时可以获得更好的性能。The AppendText method enables the user to append text to the contents of a text control without using text concatenation, which, can yield better performance when many concatenations are required.

适用于