WPF textbox 圆角制作
2013-06-28 10:48
260 查看
在app.xaml中加入以下节点,全局设置textbox圆角
<Style TargetType="{x:Type TextBox}">
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TextBox}">
<Grid>
<Rectangle RadiusX="3" RadiusY="3" Fill="{TemplateBinding Background}" Stroke="#7e94a9"/>
<ScrollViewer x:Name="PART_ContentHost" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden" Padding="{TemplateBinding Padding}" Focusable="false">
</ScrollViewer>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type TextBox}">
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TextBox}">
<Grid>
<Rectangle RadiusX="3" RadiusY="3" Fill="{TemplateBinding Background}" Stroke="#7e94a9"/>
<ScrollViewer x:Name="PART_ContentHost" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden" Padding="{TemplateBinding Padding}" Focusable="false">
</ScrollViewer>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
相关文章推荐
- 【WPF】Bitmap Effect制作圆角加渲染TextBox
- WPF Button TextBox 圆角
- WPF-控件-编辑圆角TextBox
- WPF/Silverlight TextBox 实现CornerRadius圆角
- WPF--TextBox样式使用(文字居中、背景、圆角...)
- WPF 圆角textbox
- WPF制作只有部分圆角的矩形
- WPF combobox 圆角制作
- WPF passwordbox 圆角制作
- WPF里面制作圆角文本框
- WPF将TextBox的边框设为圆角的
- WPF里面制作圆角文本框
- 使用Blend来为WPF程序制作Textbox数据绑定效果
- WPF制作圆角窗体思路
- WPF 的圆角TextBox和有水印的TextBox
- WPF/Silverlight TextBox 实现CornerRadius圆角
- WPF 关于圆角的制作
- WPF TextBox 实现CornerRadius圆角
- WPF制作带圆角的文本框的两种方法
- WPF TextBox水印效果制作方法详解