WP8滑动条(Slider)控件的使用
1.
<Grid x:Name="LayoutRoot" Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions> <!--TitlePanel 包含应用程序的名称和页标题-->
<StackPanel Grid.Row="" Margin="12,17,0,28">
<TextBlock Text="我的应用程序" Style="{StaticResource PhoneTextNormalStyle}"/>
<TextBlock Text="Slider" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
</StackPanel> <!--ContentPanel - 在此处放置其他内容-->
<Grid x:Name="ContentPanel" Grid.Row="" Margin="12,0,12,0">
<TextBlock HorizontalAlignment="Left" Height="" Margin="26,14,0,0" TextWrapping="Wrap" Text="红色" VerticalAlignment="Top" Width=""/>
<TextBlock HorizontalAlignment="Left" Height="" Margin="193,14,0,0" TextWrapping="Wrap" Text="绿色" VerticalAlignment="Top" Width=""/>
<TextBlock HorizontalAlignment="Left" Height="" Margin="341,14,0,0" TextWrapping="Wrap" Text="蓝色" VerticalAlignment="Top" Width=""/>
<Slider x:Name="RedSilder" HorizontalAlignment="Left" Height="" Margin="10,72,0,0" VerticalAlignment="Top" Width="" Maximum=""/>
<Slider x:Name="GreenSlider" HorizontalAlignment="Left" Height="" Margin="152,72,0,0" VerticalAlignment="Top" Width="" Maximum=""/>
<Slider x:Name="BlueSlider" HorizontalAlignment="Left" Height="" Margin="294,72,0,0" VerticalAlignment="Top" Width="" Maximum=""/>
<TextBlock x:Name="RedText" HorizontalAlignment="Left" Height="" Margin="26,159,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width=""/>
<TextBlock x:Name="GreenText" HorizontalAlignment="Left" Height="" Margin="167,159,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width=""/>
<TextBlock x:Name="BlueText" HorizontalAlignment="Left" Height="" Margin="312,159,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width=""/>
<Ellipse x:Name="ColorEll" Fill="#FFF4F4F5" HorizontalAlignment="Left" Height="" Margin="90,274,0,0" Stroke="Black" VerticalAlignment="Top" Width=""/> </Grid>
</Grid>
2.
namespace PhoneApp1
{
public partial class Slider : PhoneApplicationPage
{
public Slider()
{
InitializeComponent();
RedSilder.Value = ;
GreenSlider.Value = ;
BlueSlider.Value = ;
RedSilder.ValueChanged += RedSilder_ValueChanged;
GreenSlider.ValueChanged += GreenSlider_ValueChanged;
BlueSlider.ValueChanged += BlueSlider_ValueChanged;
BindColor();
} void BlueSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
BindColor();
} void GreenSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
BindColor();
} void RedSilder_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
BindColor();
} private void BindColor()
{
Color c = Color.FromArgb(, (byte)RedSilder.Value, (byte)GreenSlider.Value, (byte)BlueSlider.Value);
ColorEll.Fill = new SolidColorBrush(c);
RedText.Text = c.R.ToString("X2");
GreenText.Text =c.G.ToString("X2");
BlueText.Text = c.B.ToString("X2");
} }
}
WP8滑动条(Slider)控件的使用的更多相关文章
- VC++ 中滑动条(slider控件)使用 [转+补充]
滑动控件slider是Windows中最常用的控件之一.一般而言它是由一个滑动条,一个滑块和可选的刻度组成,用户可以通过移动滑块在相应的控件中显示对应的值.通常,在滑动控件附近一定有标签控件或编辑框控 ...
- 示例:WPF中Slider控件封装的缓冲播放进度条控件
原文:示例:WPF中Slider控件封装的缓冲播放进度条控件 一.目的:模仿播放器播放进度条,支持缓冲任务功能 二.进度: 实现类似播放器中带缓存的播放样式(播放区域.缓冲区域.全部区域等样式) 实现 ...
- [WPF]Slider控件常用方法
WPF的Slider控件继承自RangeBase类型,同继承自RangeBase的控件还有ProgressBar和ScrollBar,这类控件都是在一定数值范围内表示一个值的用途. 首先注意而Rang ...
- Unity3D 之UGUI 滑动条(Slider)
这里来讲解下UGUI 滑动条(Slider)的用法 控件下面有三个游戏对象 Background -->背景 Fill Area --> 前景区域 Handle Slide Area -- ...
- 【jQuery UI 1.8 The User Interface Library for jQuery】.学习笔记.7.Slider控件
默认slider的安装启用 为slider自定义风格 修改配置选项 创建一个垂直的slider 设置最大最小值,和默认值 启用多个 手柄 和 范围 slider内置的回调事件 slider的方法 这个 ...
- Cocos2d-X中的Slider控件
Slider控件事实上就是滑块控件.经常使用于音乐中的音量控制,在Windows编程中开发音乐播放器就须要用到滑块控件控制音量 首先在project文件夹下的Resource文件夹中放 在Skider ...
- SilverLight:基础控件使用(6)-Slider控件
ylbtech-SilverLight-Basic-Control:基础控件使用(6)-Slider控件 Slider 控件 Slider 控件的 ValueChanged 事件 1.A,返回顶部 S ...
- anjularjs slider控件替代方案
做项目需要一个slider控件,找了很久没有找到合适的指令集,无意间看到可以直接用range替代,不过样式有点丑. <label> <input type="range&q ...
- 用uGUI开发自定义Toggle Slider控件
一.前言 写完<Unity4.6新UI系统初探>后,我模仿手机上的UI分别用uGui和NGUI做了一个仅用作演示的ToggleSlider,我认为这个小小的控件已能体现自定义控件的开发过程 ...
- WP8.1 Study2:MapControl控件的应用
总的界面布局如下:
随机推荐
- AC日记——逆序对 洛谷 P1908
逆序对 思路: 线段树水过: 代码: #include <cstdio> #include <cstring> #include <iostream> #inclu ...
- AC日记——[HEOI2012]旅行问题 bzoj 2746
2746 思路: 建立ac自动机,然后把fail树抽出来: 然后在fail树上走lca(神奇): 代码: #include <cstdio> #include <vector> ...
- ZCMU Problem H: Crixalis's Equipment(贪心,排序)
#include<stdio.h> #include<stdlib.h> struct node { int a,b; }c[1002]; int cmpxy(const st ...
- IntelliJ IDEA 常用设置/快捷键
经常用到 IntelliJ IDEA 编写java,由于不时需要重装系统,所以Mark一下一些基本的设置选项,以便查询,这篇帖子会一直更新,只要有常用的新的设置或者快捷键 一.常用设置 显示代码行号 ...
- 见微知著(二):解析ctf中的pwn--怎么利用double free
这次选2015年的0ctf的一道非常经典的pwn题,感觉这个题目作为练习题来理解堆还是很棒的. 运行起来,可以看出是一个实现类似于记事本功能的程序,就这一点而言,基本是套路了,功能都试一遍之后,就可以 ...
- 【Ubuntu】使用root账户登录ubuntu
由于经常使用,所以写个博客记下来以便后来查看. 1.修改root账户密码:sudo passwd root,输密码 2.修改/usr/share/lightdm/lightdm.conf.d/50-u ...
- 【计算几何】【凸包】bzoj2829 信用卡凸包
http://hzwer.com/6330.html #include<cstdio> #include<cmath> #include<algorithm> us ...
- jdk8中Spliterator的作用
文章前半部分转自:https://blog.csdn.net/lh513828570/article/details/56673804 之前的时候看集合部分源码没看完,今天又翻了一下,看到了个东西sp ...
- 6.5(java学习笔记)其他流(字节数组流,数据流,对象流,打印流)
一.字节数组流 之前使用输入输出流的操作的对象是文件,而这里字节数组流操作的对象是内存,内存可以看做是一个字节数组. 使用字节数组流读写就可以看做是从内存A到内存B的读写,对象时内存即字节数组. 1. ...
- golang技巧-接口型函数
接口型函数:指的是用函数实现接口,这样在调用的时候就会非常简便,这种函数为接口型函数,这种方式适用于只有一个函数的接口. 定义一个类型,这个类型只定义了函数的参数列表,函数参数列表与接口定义的方法一致 ...