WPF学习之路(十二)控件(Range控件)
ProgressBar
进度条,主要属性:Minimum\Maximun\Value, IsIndeterminate为True时,进度条会循环运转
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<StackPanel Grid.Row="" VerticalAlignment="Center" HorizontalAlignment="Center">
<ProgressBar Name="pb1" Height="" Width="" Foreground="LightBlue" IsIndeterminate="True"></ProgressBar>
</StackPanel>
<StackPanel Grid.Row="" VerticalAlignment="Center" HorizontalAlignment="Center">
<ProgressBar Name="pb2" Height="" Width="" Foreground="LightBlue"></ProgressBar>
<Button Name="btn" MaxWidth="" Margin="" Click="BTN_Click">Start</Button>
</StackPanel>
</Grid>
private void BTN_Click(object sender, RoutedEventArgs e)
{
Duration duration = new Duration(TimeSpan.FromSeconds());
DoubleAnimation doubleAnimation = new DoubleAnimation(, duration);
pb2.BeginAnimation(ProgressBar.ValueProperty, doubleAnimation);
}

更多内容
http://www.codeproject.com/Articles/38555/WPF-ProgressBar
http://blog.csdn.net/tcjiaan/article/details/6963687
Silder
很常见的滑块,控件的外观上显示一系例刻度值,并存在一个可以被拖动的滑块,用户可以通过拖动滑块来控制控件的值
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Rectangle Grid.Column="" x:Name="rect" Fill="Black"></Rectangle>
<StackPanel Grid.Column="">
<StackPanel Orientation="Horizontal" Margin="10,2,5,2" >
<TextBlock Text="R" Margin="5,1,1,1" VerticalAlignment="Center"></TextBlock>
<Slider Name="RSlider" Margin="" Minimum="" Maximum="" TickFrequency="" Ticks="0,50,100,150,200,250"
TickPlacement="BottomRight" IsSnapToTickEnabled="False" ValueChanged="RSlider_ValueChanged" MinWidth=""></Slider>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="10,2,5,2" >
<TextBlock Text="G" Margin="5,1,1,1" VerticalAlignment="Center"></TextBlock>
<Slider Name="GSlider" Margin="" Minimum="" Maximum="" TickFrequency="" Ticks="0,50,100,150,200,250"
TickPlacement="BottomRight" IsSnapToTickEnabled="False" ValueChanged="GSlider_ValueChanged" MinWidth=""></Slider>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="10,2,5,2" >
<TextBlock Text="B" Margin="5,1,1,1" VerticalAlignment="Center"></TextBlock>
<Slider Name="BSlider" Margin="" Minimum="" Maximum="" TickFrequency="" Ticks="0,50,100,150,200,250"
TickPlacement="BottomRight" IsSnapToTickEnabled="False" ValueChanged="BSlider_ValueChanged" MinWidth=""></Slider>
</StackPanel>
</StackPanel>
</Grid>
private void RSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
Update();
} private void BSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
Update();
} private void GSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
Update();
} private void Update()
{
Color color = Color.FromRgb(Convert.ToByte(RSlider.Value), Convert.ToByte(BSlider.Value), Convert.ToByte(GSlider.Value));
rect.Fill = new SolidColorBrush(color);
}

更多内容
http://blog.csdn.net/tcjiaan/article/details/6997900
To be continue...
WPF学习之路(十二)控件(Range控件)的更多相关文章
- 【WPF学习】第二十二章 文本控件
WPF提供了三个用于输入文本的控件:TextBox.RichTextBox和PasswordBox.PasswordBox控件直接继承自Control类.TextBox和RichTextBox控件间接 ...
- WPF学习之路(二) XAML(续)
属性 简单属性 前面用到的Width/Height都是简单属性,其赋值一定要放到双引号里 XAML解析器会根据属性的类型执行隐式转换 与C#的区别 SolidBrush.Color = Colors. ...
- zigbee学习之路(十二):zigbee协议原理介绍
一.前言 从今天开始,我们要正式开始进行zigbee相关的通信实验了,我所使用的协议栈是ZStack 是TI ZStack-CC2530-2.3.0-1.4.0版本,大家也可以从TI的官网上直接下载T ...
- IOS学习之路十二(UITableView下拉刷新页面)
今天做了一个下拉刷新的demo,主要用到了实现的开源框架是:https://github.com/enormego/EGOTableViewPullRefresh 运行结果如下: 实现很简单下载源代码 ...
- WPF学习之路(二) XAML
在WPF中引入了XAML语言,主要用于界面设计,业务逻辑则使用C#实现后台代码,将界面设计与业务逻辑分离 XAML是一种声明式语言,类似XML\HTML 示例: <!--Start Tag--& ...
- Object-c学习之路十二(OC的copy)
oc中的拷贝分为:copy(浅拷贝)和mutablecopy(深拷贝). 浅拷贝也为指针拷贝,拷贝后原来的对象计数器会+1: 深拷贝为对象拷贝,原来的对象计数器不变. 注意:自定义对象拷贝时要实现NS ...
- Java学习之路(十二):IO流<二>
字符流 字符流是可以直接读写字符的IO流 使用字符流从文件中读取字符的时候,需要先读取到字节数据,让后在转换为字符 使用字符流向文件中写入字符时,需要把字符转为字节在写入文件 Reader和Write ...
- 嵌入式Linux驱动学习之路(十二)按键驱动-poll机制
实现的功能是在读取按键信息的时候,如果没有产生按键,则程序休眠在read函数中,利用poll机制,可以在没有退出的情况下让程序自动退出. 下面的程序就是在读取按键信息的时候,如果5000ms内没有按键 ...
- Java学习之路(十二):IO流<三>
复习:序列流 序列流可以把多个字节输入整合成一个,从序列流中读取到数据时,将从被整合的第一个流开始读取,读完这个后,然后开始读取第二个流,依次向后推. 详细见上一篇文章 ByteArrayOutput ...
- Java学习之路(十二):IO流
IO流的概述及其分类 IO流用来处理设备之间的数据传输,Java对数据的操作是通过流的方式 Java用于操作流的类都在IO包中 流按流向分为两种:输入流(读写数据) 输出流(写数据) 流按操作 ...
随机推荐
- 他答对一半(打一字)asp.net开源简答题项目
先出个字谜: 他答对一半(打一字) 你猜出来了没? 可以到这个网址答题:http://m.hovertree.com/miyu/bjae/4fpmm2td.htm 看你的答案是否正确. 这是ASP.N ...
- iOS阶段学习第19天笔记(协议-Protocol)
iOS学习(OC语言)知识点整理 一.关于协议(Protocol)的介绍 1)概念:协议指多个对象之间协商的一个接口对象,协议提供了一些方法用在协议的实现者和代理者 之间通讯的一种方式 2) ...
- DatagramSocket收发UDP数据包
Java的Socket通信分为TCP和UDP两种,Socket和ServerSocket类用于TCP通信,DatagramSocket用于UDP通信. 使用DatagramSocket发送UDP数据包 ...
- Eclipse上GIT插件EGIT使用手册
http://blog.csdn.net/luckarecs/article/details/7427605 Eclipse上GIT插件EGIT使用手册 一_安装EGIT插件 http://dow ...
- Python语言and-or的用法
[原]python语言的 and-or 常常被用来实现类C语言中的三元运算符 : ? , 更为骚气的写法是 xxx and xxx or xxx and xxx or xxx,这样就可以可以做到 ...
- spring 的自建request请求
public String myRequest() throws IOException, URISyntaxException{ String url="ht ...
- Unsupported configuration attributes: [FILE_UPLOAD]
Caused by: java.lang.IllegalArgumentException: Unsupported configuration attributes: [FILE_UPLOAD] 情 ...
- 第二章 部署war包到tomcat
以turbine为例. 一.部署 1.下载或者生成war包(从maven上下载war包,并改名字为turbine.war) 2.将turbine.war拷贝到$TOMCAT_HOME/webapps中 ...
- bootstrap源码分析之form、navbar
一.表单(Form) 源码文件:_form.scssmixins/_form.scss 1.按层次结构分:form-group -> form-control/input-group/form- ...
- SAP (ABAP) 常用的数学函数
Function func Return value abs Absolute value of the argument arg (绝对值) sign Plus/minus sign of the ...