zoukankan      html  css  js  c++  java
  • Slider 控件

    Slider:表示一种控件,该控件使用户可以通过沿着一条轨道移动 Thumb 控件来从一个值范围中进行选择。(官方文档上面写的很难懂,其实就是一个可以用鼠标拖拉来改变值的条)

    <Window x:Class="MaterialStorage.MainWindow"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            Title="MainWindow" Height="350" Width="525">
        <Grid>
            <!--在这里给网格定义了三行一列 第一行高20 第三行高20 其余的自适应-->
            <Grid.RowDefinitions>
                <RowDefinition Height="20"></RowDefinition>
                <RowDefinition Height="*"></RowDefinition>
                <RowDefinition Height="20"></RowDefinition>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" ></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <Button Grid.Row="0">按钮1</Button>
            <!-- Border 被单独拿出来,用于为一些容器绘制边框-->
            <Border BorderThickness="3" BorderBrush="Black" Grid.Row="1">
                <StackPanel x:Name="LayoutRoot" Margin="10,10,10,10">
                    <TextBlock Text="Basic Slider:" />
                    <Slider Margin="0,5,0,20" x:Name="slider1" Minimum="0" Maximum="10" />
                    <TextBlock Text="Slider with ValueChanged event handler:" />
                    <Slider Margin="0,5,0,0" x:Name="slider2" Minimum="0" Maximum="10" ValueChanged="slider2_ValueChanged" />
                    <TextBlock Margin="0,5,0,20" x:Name="textBlock1" Text="Current value: 0" />
                    <TextBlock Text="Slider with vertical orientation:" />
                    <Slider Margin="0,5,0,20" x:Name="slider3" Minimum="0" Maximum="10" Height="20" Orientation="Vertical"/>
                    <TextBlock Text="Slider with reversed direction:" />
                    <Slider Margin="0,5,0,20" x:Name="slider4" Minimum="0" Maximum="10" IsDirectionReversed="true"/>
                </StackPanel>
            </Border>
            <Button Grid.Row="2">按钮3</Button>
        </Grid>
    </Window>

  • 相关阅读:
    Python 于 webgame 的应用(上)
    TCP Nagle剖析
    配置Windows下的Git 服务器简易教程
    程序员的绘图利器 — Graphviz
    patch的制作和使用
    PyCon China 2012,我们上海见!
    Python 于 webgame 的应用(下)
    TCP接收缓存大小的动态调整
    TCP的TSO处理
    上传压死下载 & 常见TCP选项
  • 原文地址:https://www.cnblogs.com/zhuzhenyu/p/2937263.html
Copyright © 2011-2022 走看看