WPF开发工具的推出为我们带来了新一代的开发模式,开发人员摆脱了图形界面设计的局限性,可以轻松的实现精美的图形界面。下面我们就来看看WPF TextBox的使用方法#t#
默认和修改WPF TextBox控件中Template后的显示
- < Style TargetType="
{x:Type TextBox}">
- < Setter Property="Template">
- < Setter.Value>
- < ControlTemplate TargetType=
"{x:Type TextBox}">
- < Grid>
- < Border Background=
"{TemplateBinding Background}"
CornerRadius="5" />
- < Rectangle RadiusX="5"
RadiusY="5" Width="10"
HorizontalAlignment="Left">
- < Rectangle.Fill>
- < LinearGradientBrush
StartPoint="0,0" EndPoint="1,0">
- < LinearGradientBrush.GradientStops >
- < GradientStop Offset="0"
Color="Black" />
- < GradientStop Offset="0.3"
Color="YellowGreen" />
- < GradientStop Offset="1"
Color="Transparent" />
- < /LinearGradientBrush.GradientStops>
- < /LinearGradientBrush>
- < /Rectangle.Fill>
- < /Rectangle>
- < Rectangle RadiusX="5" RadiusY="5"
Height="10" Margin="3,0,0,0"
VerticalAlignment="Top" >
- < Rectangle.Fill>
- < LinearGradientBrush StartPoint="0,0"
EndPoint="0,1">
- < LinearGradientBrush.GradientStops >
- < GradientStop Offset="0" Color="Black" />
- < GradientStop Offset="0.3"
Color="YellowGreen" />
- < GradientStop Offset="1"
Color="Transparent" />
- < /LinearGradientBrush.
GradientStops>
- < /LinearGradientBrush>
- < /Rectangle.Fill>
- < /Rectangle>
- < Border CornerRadius="5"
BorderBrush="Black" BorderThickness="1" />
- < ScrollViewer Name="PART_ContentHost"
Margin="2" />
- < Border CornerRadius="6,6,0,0"
Height="15" VerticalAlignment="Top">
- < Border.Background>
- < LinearGradientBrush StartPoint="0,0"
EndPoint="0,1">
- < LinearGradientBrush.GradientStops >
- < GradientStop Offset="0"
Color="#60FFFFFF" />
- < GradientStop Offset="0.7"
Color="#40FFFFFF" />
- < /LinearGradientBrush.GradientStops>
- < /LinearGradientBrush>
- < /Border.Background>
- < /Border>
- < /Grid>
- < /ControlTemplate>
- < /Setter.Value>
- < /Setter>
- < /Style>
以上就是WPF TextBox的相关使用方法介绍。
新闻标题:WPFTextBox使用指南
分享地址:http://www.shufengxianlan.com/qtweb/news7/353607.html
网站建设、网络推广公司-创新互联,是专注品牌与效果的网站制作,网络营销seo公司;服务项目有等
广告
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源:
创新互联