如何:设置 TextBox 控件的文本内容

更新:2007 年 11 月

本示例演示如何使用 Text 属性设置 TextBox 控件的初始文本内容。

示例

<TextBox Name="tbSettingText">
  Initial text contents of the TextBox.
</TextBox>
tbSettingText.Text = "Initial text contents of the TextBox."
tbSettingText.Text = "Initial text contents of the TextBox.";

请参见

概念

TextBox 概述

RichTextBox 概述