diff --git a/doc/source/handycontrol/extend_controls/passwordBox/index.md b/doc/source/handycontrol/extend_controls/passwordBox/index.md index c48a7ee1..4d15c5cf 100644 --- a/doc/source/handycontrol/extend_controls/passwordBox/index.md +++ b/doc/source/handycontrol/extend_controls/passwordBox/index.md @@ -8,7 +8,6 @@ title: PasswordBox [TemplatePart(Name = ElementPasswordBox, Type = typeof(System.Windows.Controls.PasswordBox))] [TemplatePart(Name = ElementTextBox, Type = typeof(System.Windows.Controls.TextBox))] public class PasswordBox : Control, IDataInput - ``` # PasswordBox @@ -50,7 +49,7 @@ PasswordBox控件可以主动显示已输入的密码。将`ShowEyeButton`设置 # 设置标题和占位符文本 -你可以将 Header(标题)和 Placeholder(占位符)添加到PasswordBox,以向用户指示其用途。要使用这两个属性,首先需要应用 **TimePickerExtend** 或 **TimePickerPlus** 样式。 +你可以将 Header(标题)和 Placeholder(占位符)添加到PasswordBox,以向用户指示其用途。 ``` XML +``` + +``` CS +var textBox = new TextBox(); +``` + + + + +# 输入文本 + +此示例演示如何使用 Text 属性设置 TextBox 控件的初始文本内容: + +``` XML + +``` + +``` CS +textBox.Text = "这是内容"; +``` + +生成的TextBox如下图所示: + +![TextBox](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Doc/extend_controls/TextBox_1.png) + + +有关TextBox的更多示例,可以参考它的基类的[文档](https://docs.microsoft.com/zh-cn/dotnet/api/system.windows.controls.textbox?view=netframework-4.8)。 + + +# 设置标题和占位符文本 + +你可以将 Header(标题)和 Placeholder(占位符)添加到TextBox,以向用户指示其用途。要使用这两个属性, + +``` XML +