TextBoxStyle.xaml 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  3. <Style x:Key="TextBoxStyle" TargetType="TextBox">
  4. <Setter Property="Margin" Value="0,1" />
  5. <Setter Property="Height" Value="23" />
  6. <Setter Property="Template">
  7. <Setter.Value>
  8. <ControlTemplate TargetType="{x:Type TextBox}">
  9. <Border x:Name="border" Width="Auto" BorderThickness="1" BorderBrush="DimGray" >
  10. <Grid x:Name="grid" Background="#FFFFFF">
  11. <ScrollViewer x:Name="PART_ContentHost" VerticalAlignment="Center" HorizontalAlignment="Left"></ScrollViewer>
  12. </Grid>
  13. </Border>
  14. </ControlTemplate>
  15. </Setter.Value>
  16. </Setter>
  17. </Style>
  18. <Style x:Key="TextBoxStyleTemplateBinding" TargetType="TextBox">
  19. <Setter Property="Margin" Value="0,1" />
  20. <Setter Property="Height" Value="23" />
  21. <Setter Property="Template">
  22. <Setter.Value>
  23. <ControlTemplate TargetType="{x:Type TextBox}">
  24. <Border x:Name="border" Width="Auto" BorderThickness="1" BorderBrush="{TemplateBinding BorderBrush}" >
  25. <Grid x:Name="grid" Background="#FFFFFF">
  26. <ScrollViewer x:Name="PART_ContentHost" VerticalAlignment="Center" HorizontalAlignment="Left"></ScrollViewer>
  27. </Grid>
  28. </Border>
  29. </ControlTemplate>
  30. </Setter.Value>
  31. </Setter>
  32. </Style>
  33. <Style x:Key="CommonTextBoxStyle" TargetType="TextBox">
  34. <Setter Property="Margin" Value="0,1" />
  35. <Setter Property="Height" Value="22" />
  36. <Setter Property="Template">
  37. <Setter.Value>
  38. <ControlTemplate TargetType="{x:Type TextBox}">
  39. <Border x:Name="Border1" Width="Auto" BorderBrush="DarkGray" BorderThickness="1">
  40. <Grid x:Name="grid" Background="#FFFFFF">
  41. <ScrollViewer x:Name="PART_ContentHost" VerticalAlignment="Center" HorizontalAlignment="Left"></ScrollViewer>
  42. </Grid>
  43. </Border>
  44. </ControlTemplate>
  45. </Setter.Value>
  46. </Setter>
  47. </Style>
  48. </ResourceDictionary>