我不知道WPF,現在正在學習它。我正在尋找WPF中的圓角TextBox
。所以,我搜索谷歌和發現了一張XAML
:WPF圓角文本框
<!–Rounded Corner TextBoxes–>
<ControlTemplate x:Key=」RoundTxtBoxBaseControlTemplate」 TargetType=」{x:Type Control}」>
<Border Background=」{TemplateBinding Background}」 x:Name=」Bd」 BorderBrush=」{TemplateBinding BorderBrush}」
BorderThickness=」{TemplateBinding BorderThickness}」 CornerRadius=」6″>
<ScrollViewer x:Name=」PART_ContentHost」/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property=」IsEnabled」 Value=」False」>
<Setter Property=」Background」 Value=」{DynamicResource {x:Static SystemColors.ControlBrushKey}}」 TargetName=」Bd」/>
<Setter Property=」Foreground」 Value=」{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}」/>
</Trigger>
<Trigger Property=」Width」 Value=」Auto」>
<Setter Property=」MinWidth」 Value=」100″/>
</Trigger>
<Trigger Property=」Height」 Value=」Auto」>
<Setter Property=」MinHeight」 Value=」20″/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
所以,請告訴我在哪裏粘貼此XAML
。請詳細幫助我。我是WPF的初學者。
這些線最後一個我發現的有用的簡單的解決方案: `<文本框的文本= 「文本框與CornerRadius」> <樣式的TargetType = 「{x:邊框類型}」> ` –
Smolla
2013-02-13 16:30:13