[英]C# WPF How do I add a border to a style?
我正在為 App.xaml 中的按鈕創建樣式。 如何為樣式添加邊框? 然后如何使用 MainWindow.xaml 中的樣式?
我找不到怎么做。 我不想為了邊框而把它放在一個單獨的樣式中。
在申請.xaml
<Style x:Key="BorderedButton" TargetType="Button">
<Setter Property="BorderBrush" Value="HotPink"/>
<Setter Property="BorderThickness" Value="2"/>
</Style>
並在視圖中
<Button Style="{StaticResource BorderedButton}"/>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.