1.

  1. <Grid x:Name="LayoutRoot" Background="Transparent">
  2. <Grid.RowDefinitions>
  3. <RowDefinition Height="Auto"/>
  4. <RowDefinition Height="*"/>
  5. </Grid.RowDefinitions>
  6.  
  7. <!--TitlePanel 包含应用程序的名称和页标题-->
  8. <StackPanel Grid.Row="" Margin="12,17,0,28">
  9. <TextBlock Text="我的应用程序" Style="{StaticResource PhoneTextNormalStyle}"/>
  10. <TextBlock Text="Slider" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
  11. </StackPanel>
  12.  
  13. <!--ContentPanel - 在此处放置其他内容-->
  14. <Grid x:Name="ContentPanel" Grid.Row="" Margin="12,0,12,0">
  15. <TextBlock HorizontalAlignment="Left" Height="" Margin="26,14,0,0" TextWrapping="Wrap" Text="红色" VerticalAlignment="Top" Width=""/>
  16. <TextBlock HorizontalAlignment="Left" Height="" Margin="193,14,0,0" TextWrapping="Wrap" Text="绿色" VerticalAlignment="Top" Width=""/>
  17. <TextBlock HorizontalAlignment="Left" Height="" Margin="341,14,0,0" TextWrapping="Wrap" Text="蓝色" VerticalAlignment="Top" Width=""/>
  18. <Slider x:Name="RedSilder" HorizontalAlignment="Left" Height="" Margin="10,72,0,0" VerticalAlignment="Top" Width="" Maximum=""/>
  19. <Slider x:Name="GreenSlider" HorizontalAlignment="Left" Height="" Margin="152,72,0,0" VerticalAlignment="Top" Width="" Maximum=""/>
  20. <Slider x:Name="BlueSlider" HorizontalAlignment="Left" Height="" Margin="294,72,0,0" VerticalAlignment="Top" Width="" Maximum=""/>
  21. <TextBlock x:Name="RedText" HorizontalAlignment="Left" Height="" Margin="26,159,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width=""/>
  22. <TextBlock x:Name="GreenText" HorizontalAlignment="Left" Height="" Margin="167,159,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width=""/>
  23. <TextBlock x:Name="BlueText" HorizontalAlignment="Left" Height="" Margin="312,159,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width=""/>
  24. <Ellipse x:Name="ColorEll" Fill="#FFF4F4F5" HorizontalAlignment="Left" Height="" Margin="90,274,0,0" Stroke="Black" VerticalAlignment="Top" Width=""/>
  25.  
  26. </Grid>
  27. </Grid>

2.

  1. namespace PhoneApp1
  2. {
  3. public partial class Slider : PhoneApplicationPage
  4. {
  5. public Slider()
  6. {
  7. InitializeComponent();
  8. RedSilder.Value = ;
  9. GreenSlider.Value = ;
  10. BlueSlider.Value = ;
  11. RedSilder.ValueChanged += RedSilder_ValueChanged;
  12. GreenSlider.ValueChanged += GreenSlider_ValueChanged;
  13. BlueSlider.ValueChanged += BlueSlider_ValueChanged;
  14. BindColor();
  15. }
  16.  
  17. void BlueSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
  18. {
  19. BindColor();
  20. }
  21.  
  22. void GreenSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
  23. {
  24. BindColor();
  25. }
  26.  
  27. void RedSilder_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
  28. {
  29. BindColor();
  30. }
  31.  
  32. private void BindColor()
  33. {
  34. Color c = Color.FromArgb(, (byte)RedSilder.Value, (byte)GreenSlider.Value, (byte)BlueSlider.Value);
  35. ColorEll.Fill = new SolidColorBrush(c);
  36. RedText.Text = c.R.ToString("X2");
  37. GreenText.Text =c.G.ToString("X2");
  38. BlueText.Text = c.B.ToString("X2");
  39. }
  40.  
  41. }
  42. }

WP8滑动条(Slider)控件的使用的更多相关文章

  1. VC++ 中滑动条(slider控件)使用 [转+补充]

    滑动控件slider是Windows中最常用的控件之一.一般而言它是由一个滑动条,一个滑块和可选的刻度组成,用户可以通过移动滑块在相应的控件中显示对应的值.通常,在滑动控件附近一定有标签控件或编辑框控 ...

  2. 示例:WPF中Slider控件封装的缓冲播放进度条控件

    原文:示例:WPF中Slider控件封装的缓冲播放进度条控件 一.目的:模仿播放器播放进度条,支持缓冲任务功能 二.进度: 实现类似播放器中带缓存的播放样式(播放区域.缓冲区域.全部区域等样式) 实现 ...

  3. [WPF]Slider控件常用方法

    WPF的Slider控件继承自RangeBase类型,同继承自RangeBase的控件还有ProgressBar和ScrollBar,这类控件都是在一定数值范围内表示一个值的用途. 首先注意而Rang ...

  4. Unity3D 之UGUI 滑动条(Slider)

    这里来讲解下UGUI 滑动条(Slider)的用法 控件下面有三个游戏对象 Background -->背景 Fill Area --> 前景区域 Handle Slide Area -- ...

  5. 【jQuery UI 1.8 The User Interface Library for jQuery】.学习笔记.7.Slider控件

    默认slider的安装启用 为slider自定义风格 修改配置选项 创建一个垂直的slider 设置最大最小值,和默认值 启用多个 手柄 和 范围 slider内置的回调事件 slider的方法 这个 ...

  6. Cocos2d-X中的Slider控件

    Slider控件事实上就是滑块控件.经常使用于音乐中的音量控制,在Windows编程中开发音乐播放器就须要用到滑块控件控制音量 首先在project文件夹下的Resource文件夹中放 在Skider ...

  7. SilverLight:基础控件使用(6)-Slider控件

    ylbtech-SilverLight-Basic-Control:基础控件使用(6)-Slider控件 Slider 控件 Slider 控件的 ValueChanged 事件 1.A,返回顶部 S ...

  8. anjularjs slider控件替代方案

    做项目需要一个slider控件,找了很久没有找到合适的指令集,无意间看到可以直接用range替代,不过样式有点丑. <label> <input type="range&q ...

  9. 用uGUI开发自定义Toggle Slider控件

    一.前言 写完<Unity4.6新UI系统初探>后,我模仿手机上的UI分别用uGui和NGUI做了一个仅用作演示的ToggleSlider,我认为这个小小的控件已能体现自定义控件的开发过程 ...

  10. WP8.1 Study2:MapControl控件的应用

    总的界面布局如下:

随机推荐

  1. Codeforces 626 C. Block Towers-二分 (8VC Venture Cup 2016-Elimination Round)

      C. Block Towers   time limit per test 2 seconds memory limit per test 256 megabytes input standard ...

  2. CF 1003C Intense Heat【前缀和/精度/双层暴力枚举】

    The heat during the last few days has been really intense. Scientists from all over the Berland stud ...

  3. while(scanf("%d",&n)!=EOF)

    scanf的返回值由后面的参数决定 scanf("%d%d", &a, &b); 如果a和b都被成功读入,那么scanf的返回值就是2 如果只有a被成功读入,返回值 ...

  4. jmeter 线程组之间的参数传递

    http://www.cnblogs.com/wnfindbug/p/5817277.html 场景测试中,一次登录后做多个接口的操作,然后登录后的uid需要关联传递给其他接口发送请求的时候使用. 1 ...

  5. Android开机过程

    韩梦飞沙  韩亚飞  313134555@qq.com  yue31313  han_meng_fei_sha Android开机过程 BootLoder引导,然后加载Linux内核. 0号进程ini ...

  6. AtCoder - 2567 RGB Sequence

    Problem Statement There are N squares arranged in a row. The squares are numbered 1, 2, …, N, from l ...

  7. HDOJ 4903 The only survival

    Discription: There is an old country and the king fell in love with a devil. The devil always ask th ...

  8. 【枚举】【贪心】 Codeforces Round #398 (Div. 2) B. The Queue

    卡题意……妈的智障 一个人的服务时间完整包含在整个工作时间以内. 显然,如果有空档的时间,并且能再下班之前完结,那么直接输出即可,显然取最左侧的空档最优. 如果没有的话,就要考虑“挤掉”某个人,就是在 ...

  9. [美团 CodeM 初赛 Round A]数列互质

    题目大意: 给出一个长度为n的数列a1,a2,a3,...,an,以及m组询问(li,ri,ki),求区间[li,ri]中有多少数在该区间中的出现次数与ki互质. 思路: 莫队. f[i]记录数字i出 ...

  10. new beginning

    新的一年开始. BLOG搬到CNBLOG. 往事太匆匆, 一切终成风. 他日再相逢, 依旧笑语中. -----AT.Y