WPF中基于范围的控件
1. Slider控件
Orientation
属性控制控件水平或垂直方法Maximum
属性设置最大值Value
设置默认值TickPlacement
设置刻度的位置TickFrequency
设置刻度的间隔Tick
属性设置不规则的刻度,会覆盖TickFrequency
的设置IsSelectionRangeEnabled="True" SelectionStart="70" SelectionEnd="100"
使一段范围填充显示SmallChange="5" LargeChange="15"
小刻度变化由左右键控制,大刻度值由PageUp、PageDown控制
<Slider Margin="25" Orientation="Horizontal" Height="25" Maximum="100" Value="58"
TickPlacement="BottomRight" TickFrequency="10" Ticks="15,55,75"
IsSelectionRangeEnabled="True" SelectionStart="70" SelectionEnd="100"
SmallChange="5" LargeChange="15"></Slider>
2. ProgressBar控件
长时间运行的指示器
Maximum="100" Minimum="0"
设置最大值、最小值
<ProgressBar x:Name="ProgressBar1" Height="25" Maximum="100" Minimum="0" IsIndeterminate="True"></ProgressBar>
<Button Content="Button" HorizontalAlignment="Left" Margin="376,289,0,0" VerticalAlignment="Top"
Width="75" Click="Button_Click"/>
private void Button_Click(object sender, RoutedEventArgs e)
{
ProgressBar1.Value += 5;
}
IsIndeterminate="True"
不知道何时结束时使用