终端一体化运控平台
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

TextBoxStyle.xaml 2.1 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  2. <!--#region 输入框样式-->
  3. <Style x:Key="TextBoxStyle" TargetType="TextBox">
  4. <Setter Property="Background" Value="Transparent" />
  5. <Setter Property="CaretBrush" Value="#009DFF" />
  6. <Setter Property="Foreground" Value="#009dff" />
  7. <Setter Property="FontSize" Value="20" />
  8. <Setter Property="Template">
  9. <Setter.Value>
  10. <ControlTemplate TargetType="TextBox">
  11. <Border
  12. x:Name="border"
  13. Background="{TemplateBinding Background}"
  14. BorderBrush="{TemplateBinding BorderBrush}"
  15. BorderThickness="0"
  16. CornerRadius="0"
  17. Opacity="0.7"
  18. SnapsToDevicePixels="true">
  19. <Grid>
  20. <Image Source="/BPASmartClient.CustomResource;component/Image/textBox.png" Stretch="Fill" />
  21. <ScrollViewer
  22. x:Name="PART_ContentHost"
  23. Grid.Column="1"
  24. MinHeight="20"
  25. VerticalAlignment="Center"
  26. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  27. </Grid>
  28. </Border>
  29. <ControlTemplate.Triggers>
  30. <Trigger Property="IsMouseOver" Value="true">
  31. <Setter TargetName="border" Property="Opacity" Value="1" />
  32. </Trigger>
  33. <Trigger Property="IsKeyboardFocused" Value="true">
  34. <Setter TargetName="border" Property="BorderBrush" Value="#FF569DE5" />
  35. </Trigger>
  36. </ControlTemplate.Triggers>
  37. </ControlTemplate>
  38. </Setter.Value>
  39. </Setter>
  40. </Style>
  41. <!--#endregion-->
  42. </ResourceDictionary>