- 浏览: 648117 次
- 性别:
- 来自: 石家庄
文章分类
最新评论
-
abao1:
老贾 在安装IDEA的过程中,在激活步骤时,按如下操作即可: ...
IntelliJ IDEA 2016注册方法和注册码 -
bo_hai:
./usr/bin/java: symbol lookup ...
jmagick安装步骤 -
wxcking:
不错的, 收藏一下
JAVA使用POI生成Excel文件 -
zgyfh:
大哥,密码是多少啊?zgyfh@tom.com谢谢了!新手学习 ...
WPF做的必备示例 -
记忆无泪:
jiasongmao 写道你的邮箱是多少,我可以发源代码到邮箱 ...
WPF做的必备示例
样式代码:
使用示例:
文章来源:http://tech.ddvip.com/2008-11/122587530789359.html
<Application.Resources> <!--ListBox样式--> <Style TargetType="ListBox"> <Setter Property="BorderBrush" Value="#BDD4F1"/> <Setter Property="BorderThickness" Value="1"/> <Setter Property="Background" Value="#F8F7F5"/> <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Hidden"/> <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/> <Setter Property="ScrollViewer.CanContentScroll" Value="true"/> <Setter Property="VerticalContentAlignment" Value="Center"/> </Style> <!--ListBoxItem样式--> <Style TargetType="ListBoxItem"> <Setter Property="Foreground" Value="#B5BABF"/> <Setter Property="OverridesDefaultStyle" Value="True"/> <Setter Property="Height" Value="24"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="ListBoxItem"> <Border Name="back" BorderBrush="#F8F7F5" BorderThickness="0,1,0,1"> <Border.Background> <LinearGradientBrush StartPoint="0,0" EndPoint="0,1"> <GradientBrush.GradientStops> <GradientStopCollection> <GradientStop Color="#F8F7F5" Offset="0.0"/> <GradientStop Color="#F8F7F5" Offset="0.5"/> <GradientStop Color="#F8F7F5" Offset="0.51"/> <GradientStop Color="#F8F7F5" Offset="1"/> </GradientStopCollection> </GradientBrush.GradientStops> </LinearGradientBrush> </Border.Background> <CheckBox Margin="2,0,0,0" VerticalAlignment="Center" IsChecked="{Binding RelativeSource={RelativeSource TemplatedParent},Path=IsSelected,Mode=TwoWay}"> <ContentPresenter Margin="2"/> </CheckBox> </Border> <ControlTemplate.Triggers> <Trigger Property="IsSelected" Value="True"> <Trigger.EnterActions> <BeginStoryboard> <Storyboard> <DoubleAnimation To="32" Duration="0:0:0.3" Storyboard.TargetProperty="Height"/> <ColorAnimation To="#F3C37C" Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" /> <ColorAnimation To="#952B00" Duration="0:0:0.2" Storyboard.TargetProperty="(ListBoxItem.Foreground).(SolidColorBrush.Color)" /> <ColorAnimation To="#FFF" Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" /> <ColorAnimation To="#FFEF99" Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" /> <ColorAnimation To="#FFE13F" Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[2].(GradientStop.Color)" /> <ColorAnimation To="#FFF3B0" Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[3].(GradientStop.Color)" /> </Storyboard> </BeginStoryboard> </Trigger.EnterActions> <Trigger.ExitActions> <BeginStoryboard> <Storyboard> <DoubleAnimation BeginTime="0:0:0.4" Duration="0:0:0.2" Storyboard.TargetProperty="Height"/> <ColorAnimation Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" /> <ColorAnimation Duration="0:0:0.2" Storyboard.TargetProperty="(ListBoxItem.Foreground).(SolidColorBrush.Color)" /> <ColorAnimation Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" /> <ColorAnimation Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" /> <ColorAnimation Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[2].(GradientStop.Color)" /> <ColorAnimation Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[3].(GradientStop.Color)" /> </Storyboard> </BeginStoryboard> </Trigger.ExitActions> </Trigger> <Trigger Property="IsMouseOver" Value="True"> <Trigger.EnterActions> <BeginStoryboard> <Storyboard> <ColorAnimation To="#D8E6F5" Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" /> <ColorAnimation To="#617A98" Duration="0:0:0.2" Storyboard.TargetProperty="(ListBoxItem.Foreground).(SolidColorBrush.Color)" /> <ColorAnimation To="#F6F9FD" Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" /> <ColorAnimation To="#E0EBF7" Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" /> <ColorAnimation To="#D7E5F6" Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[2].(GradientStop.Color)" /> <ColorAnimation To="#F6F9FD" Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[3].(GradientStop.Color)" /> </Storyboard> </BeginStoryboard> </Trigger.EnterActions> <Trigger.ExitActions> <BeginStoryboard> <Storyboard> <ColorAnimation Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" /> <ColorAnimation Duration="0:0:0.2" Storyboard.TargetProperty="(ListBoxItem.Foreground).(SolidColorBrush.Color)" /> <ColorAnimation Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" /> <ColorAnimation Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" /> <ColorAnimation Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[2].(GradientStop.Color)" /> <ColorAnimation Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[3].(GradientStop.Color)" /> </Storyboard> </BeginStoryboard> </Trigger.ExitActions> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style> </Application.Resources>
使用示例:
<ListBox Margin="19,32,21,40" Name="listBox1" SelectionMode="Multiple"> <ListBoxItem>WPF界面设计技巧(7)—模拟电梯升降的缓动动画 (7-22 16:41) </ListBoxItem> <ListBoxItem>WPF界面设计技巧(6)—玩玩数字墨水手绘涂鸦 (7-19 01:20) </ListBoxItem> <ListBoxItem>WPF界面设计技巧(5)—自定义列表项呈现内容 (7-17 12:25) </ListBoxItem> <ListBoxItem>WPF界面设计技巧(4)—自定义列表项样式 (7-16 23:02) </ListBoxItem> <ListBoxItem>WPF界面设计技巧(3)—实现不规则动画按钮 (7-15 23:17) </ListBoxItem> <ListBoxItem>WPF界面设计技巧(2)—自定义漂亮的按钮样式 (7-15 01:56) </ListBoxItem> <ListBoxItem>WPF界面设计技巧(1)—不规则窗体图文指南 (7-13 22:24) </ListBoxItem> </ListBox>
文章来源:http://tech.ddvip.com/2008-11/122587530789359.html
发表评论
-
wpf开源项目
2019-12-03 11:35 584SharpDevelop SharpDevelop是一款用 ... -
wpf datagrid样式
2014-12-23 22:42 1026http://www.iringo.cn/wpf-datag ... -
WPF 的全球化
2010-10-06 00:40 1360本主题介绍了您在编写面向全球市场的 Windows Pre ... -
WPF如何:对应用程序进行本地化
2010-10-06 00:28 1297本教程演示如何使用 LocBaml 工具创建本地化的应用程 ... -
WPF 全球化和本地化概述
2010-10-06 00:25 1686当您将自己的产品限制为只能通过一种语言使用时,您便将潜在的 ... -
WPF概述一
2010-02-03 10:59 0以前在工作之余学习了WPF,感觉WPF对于软件界面的表现不仅快 ... -
WPF中如何让程序支持国际化
2009-12-23 01:47 1631如果想让我们的应用程序支持多国语言,就像瑞星那么样支持中日英三 ... -
MediaElement详解
2009-12-23 09:32 1989MediaElement:播放器 MediaOpen ... -
WPF电子书
2010-01-18 10:47 1642一些好的电子书 -
WPF开发之mvvm插件
2010-01-18 10:45 1264该插件的使用请参见附件示例 -
WPF开发3D工具类
2010-01-18 10:44 1200请参见附件 -
使用WPFRibbonCTP开发类似于office 2007界面的WPF应用程序
2010-01-18 10:42 1430具体请参见附件 -
MediaElement详解
2009-10-29 14:00 1738MediaElement:播放器 MediaOp ... -
HLSL自定义渲染特效之完美攻略(中)
2009-10-23 15:40 1264通过上一节的解说,大家是否已经对HLSL有了较深刻的认识和理解 ... -
HLSL自定义渲染特效之完美攻略(上)
2009-10-23 15:15 2644Shader Effect中文名称为“渲染特效”或“滤镜”,W ... -
基于像素的图像合成(For Silverlight)
2009-10-23 14:36 1073本节我将为大家讲解如何在Silverlight平台上实现上一节 ... -
基于像素的图像合成(For WPF)
2009-10-23 14:33 2601传统的基于GDI或G ... -
WPF中如何让程序支持国际化
2009-09-18 11:48 1891如果想让我们的应用程序支持多国语言,就像瑞星那么样支持中日英三 ... -
WPF中的依赖属性
2009-09-17 10:57 1925依赖属性 (Dependency Property) ... -
wpf仿vista得玻璃效果按钮
2009-07-31 10:07 4809仿vista玻璃效果的按钮样式: <Style x ...
相关推荐
wpf listbox notes 样式重写wpf listbox notes 样式重写wpf listbox notes 样式重写wpf listbox notes 样式重写wpf listbox notes 样式重写
WPF listBox 漂亮的listBOX
listbox在sqlite存取信息,listbox手机样式显示
WPF/C#中的ListView、ListBox的背景样式、 选中行样式,可自定义选中行项的背景颜色、圆角、方形等任意形状的背景以及前景色!以ListView为例说明,使用时如下: ...
c# 重写的listbox 有比较好看的样式
为listbox增加checkbox组件
WPF 带有checkbox的ListBox控件,支持绑定!
ListBox控件源码比VB自带的漂亮的多.rar
自己写的一个CheckListBox控件,即既能Check也能Select的控件,由于大部分功能是保留ListBox的,因此,CheckableListBoxItem从ListBoxItem派生,CheckListBox从ListBox派生,可以减少许多代码处理。
ListBox复选并取值问题,点选同时,取listbox的多项被选中的值.winform的
一个简单的示例教你如何使用代码实现winform中的listbox控件的拖拽排序
VB.NET ListBox内容用鼠标拖动和按钮移动实现排序功能 VS2010
listbox与textbox组合,实现类似google、百度搜索的模糊查询功能。textbox中输入数据,连接数据库进行模糊查找数据库记录,在将记录加载到listbox中。双击listbox中查询到的记录,再传递到testbox中显示。 希望能给...
wpf修改ListView和ListBox风格,介绍了在wpf中ListView和ListBox的使用
WPF中Listbox 的样式,非常美观大方
WPF listbox 平滑滚动
WPF ListBox控件拖动Demo,利用鼠标拖动ListBox实现多选!
c# Listbox自动滚动
WPF ListBox中显示图片,很小的例子,就几行代码。ItemTemplate中加入一个Image控件
(1)通过鼠标可以将一个ListBox控件中的任意一项拖到另一个ListBox控件中,反之亦然;(2)拖动时,鼠标呈手势状,以拖动操作更具形象化。