如何增加文本框控件XAML的大小

时间:2017-02-03 06:55:21

标签: css xaml uwp uwp-xaml

我需要增加' X'在文本框控件中。

什么是样式属性名称?

FontSize属性仅更改字体的大小,并且设置文本框的宽度/高度不会更改右侧的清除按钮的大小。

enter image description here

1 个答案:

答案 0 :(得分:3)

首先,您需要复制TextBox的{​​{3}}。

然后去找这个元素 -

<TextBlock x:Name="GlyphElement"
           AutomationProperties.AccessibilityView="Raw"
           Foreground="{ThemeResource TextControlButtonForeground}"
           FontStyle="Normal"
           FontSize="12"
           FontFamily="{ThemeResource SymbolThemeFontFamily}"
           HorizontalAlignment="Center"
           Text="&#xE10A;"
           VerticalAlignment="Center" />

注意FontSize设置为12。将其更改为 -

FontSize="{TemplateBinding FontSize}"

现在,FontSize的{​​{1}}将与其模板化父级GlyphElement同步(即FontSize),其中DeleteButtonFontSize与其模板化的父TextBox同步。

如果现在增加FontSize的{​​{1}},您会看到文字和 X 都会变大。