重写文本框:
<Style TargetType="TextBox">
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="TextBox">
<Border x:Name="PART_ContentHost" Focusable="False" Background="{TemplateBinding Background}"
CornerRadius="5" BorderBrush="Black" BorderThickness="1"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
输出截图:
重写下拉框的背景颜色:
<Rectangle.Fill>
<LinearGradientBrush EndPoint="0.5,1"StartPoint=“0.5,0”>
</Rectangle.Fill>
输出截图: