Styles
Style |
---|
TextBoxBaseStyle |
TextBox.Small |
TextBoxExtend |
TextBoxExtend.Small |
TextBoxBaseStyle
The default style of the native textbox is not recommended. It should always be used by other styles as BasedOn.
-Default style
1 | <TextBox Width="200" VerticalAlignment="Center"/> |
TextBoxExtendBaseStyle : TextBoxBaseStyle
The native textbox extends the default style. It is not recommended to use it directly. It should always be used by other styles based on On.
TextBoxExtend : TextBoxExtendBaseStyle
Compared with the default style of the native textbox, it can achieve the functions of title and watermark with the help of additional attributes.
Title on
1
<TextBox Style="{StaticResource TextBoxExtend}" hc:InfoElement.Title="This is the title" Width="200" VerticalAlignment="Center"/>
Title on left
1
<TextBox Style="{StaticResource TextBoxExtend}" hc:InfoElement.TitlePlacement="Left" hc:InfoElement.Title="This is the title" Width="300" VerticalAlignment="Center"/>
When the title is on the left, in order to align the left sides of multiple input boxes, the title width needs to be set. The title width does not need to be set one by one, and can be set uniformly on the external container.
Title on top with watermark
See ComboboxTitle is above, with watermark, and is required
See ComboboxThe title is on the top, with a watermark, and it is required, and the required prompt is customized
See Combobox