zoukankan      html  css  js  c++  java
  • WPF TextBox 搜索框 自定义





    <Style x:Key="SearchTextBoxStyle" BasedOn="{x:Null}" TargetType="{x:Type TextBox}"> <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/> <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/> <Setter Property="BorderBrush" Value="{StaticResource TextBoxBorder}"/> <Setter Property="BorderThickness" Value="1"/> <Setter Property="Padding" Value="1"/> <Setter Property="AllowDrop" Value="true"/> <Setter Property="FocusVisualStyle" Value="{x:Null}"/> <Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst"/> <Setter Property="Stylus.IsFlicksEnabled" Value="False"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type TextBox}"> <Grid> <Rectangle x:Name="Bd" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="{TemplateBinding BorderThickness}" Fill="{TemplateBinding Background}" SnapsToDevicePixels="true" RadiusX="5" RadiusY="5"> </Rectangle> <ScrollViewer x:Name="PART_ContentHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Template="{DynamicResource ScrollViewerControlTemplate1}"/> </Grid> <ControlTemplate.Triggers> <Trigger Property="IsEnabled" Value="false"> <Setter Property="Fill" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/> <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style>
  • 相关阅读:
    递归回溯 UVa140 Bandwidth宽带
    嵌入式设备网络设置
    海思板卡SATA最佳读写块大小测试
    Linux日志轮循实现(shell)
    检测应用的内存泄漏情况(shell)
    Python的交叉编译移植至arm板
    写一个简单的配置文件和日志管理(shell)
    shell 实现主板测试
    主板硬件性能测试
    C语言 模2除法
  • 原文地址:https://www.cnblogs.com/denghejun/p/3843122.html
Copyright © 2011-2022 走看看