ProgressBar - 작업의 진행 상태와 같은 UI를 표시하기 위해서 사용 가능 - IsIndeterminate 프로퍼티를 설정하여 진행 상태를 두 가지 형태로 표시 가능 |
ProgressBar.Xaml
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480"> <StackPanel> <StackPanel> <StackPanel Orientation="Horizontal" Height="20" Width="300"> <Button x:Name="btnMinus" Content="-10" Click="btnMinus_Click" Width="30" Height="20"/> <Button x:Name="btnPlus" Content="+10" Click="btnPlus_Click" Width="30" Height="20"/> </StackPanel> <TextBox Text="IsIndeterminate가 False" Height="20" Width="300" /> <ProgressBar x:Name="pgbar1" Height="20" Width="300" Value="50" Minimum="0" Maximum="100" IsIndeterminate="False" /> </StackPanel> <StackPanel> <TextBox Text="IsIndeterminate가 True " Height="20" Width="300" /> <ProgressBar x:Name="pgbar2" Height="20" Width="300" IsIndeterminate="True" /> </StackPanel> </StackPanel> </UserControl> |
ProgressBar .Cs using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Shapes; namespace ProgressBarExample { public partial class MainPage : UserControl { public MainPage() { InitializeComponent(); } private void btnMinus_Click(object sender, RoutedEventArgs e) { //pgbar1 ProgressBar의 Value를 10 감소 pgbar1.Value -= 10; } private void btnPlus_Click(object sender, RoutedEventArgs e) { //pgbar1 ProgressBar의 Value를 10 증가 pgbar1.Value += 10; } } } |
'.Net Project > SilverLight 3.0' 카테고리의 다른 글
52장 Tab 컨트롤 (0) | 2009.12.02 |
---|---|
51장 Slider 컨트롤 (0) | 2009.12.02 |
49장 ListBox 컨트롤 (0) | 2009.12.02 |
48장 ComboBox 컨트롤 (0) | 2009.12.02 |
47장 RoutedEventArgs 컨트롤 (0) | 2009.12.01 |