2017-02-03 28 views
0

我需要增加文本框控件中'X'的大小。如何增加文本框控件的大小XAML

什麼是樣式屬性名稱?

FontSize屬性只更改字體的大小,並且設置文本框的寬度/高度不會更改右側清除按鈕的大小。

enter image description here

+2

您需要編輯'TextBox'的默認樣式。 –

+0

這是我的問題。這是什麼樣式的屬性名稱? – user789897

+0

@Dave您是否通過Justin XL的解決方案解決了您的問題? –

回答

3

首先,你需要複製TextBoxdefault style

然後去找這個元素 -

<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}" 

現在,GlyphElementFontSize將在同步與其模板父的FontSize(即DeleteButton),其中FontSize然後在同步與其模板父TextBox

如果您現在增加TextBoxFontSize,您會看到文字和X變大。