Silverlight(5) - 2.0控件之ListBox, MediaElement, MultiScaleImage, PasswordBox, ProgressBar, RadioButton
2008-11-14 11:50:48 来源:WEB开发网ProgressBar.xaml.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 Silverlight20.Control
{
public partial class ProgressBar : UserControl
{
Storyboard _loop = new Storyboard();
int _count = 0;
public ProgressBar()
{
InitializeComponent();
ProgressBarDemo();
}
void ProgressBarDemo()
{
_loop.Duration = TimeSpan.FromMilliseconds(100d);
_loop.Completed += new EventHandler(_loop_Completed);
_loop.Begin();
}
void _loop_Completed(object sender, EventArgs e)
{
progressBar.Value = _count;
lblPercent.Text = _count.ToString() + "%";
if (_count > 100)
_count = 0;
else
_count++;
_loop.Begin();
}
}
}
Tags:Silverlight 控件 ListBox
编辑录入:爽爽 [复制链接] [打 印]- ››ListBox 滑动到底部自动加载数据
- ››silverlight全屏显示图片
- ››控件一:Gallery 之无限循环的问题
- ››控件一:Gallery 之基础用法
- ››Silverlight MVVM 模式(一) 切近实战
- ››Silverlight for Windows Phone 7开发系列(1):...
- ››Silverlight for Windows Phone 7开发系列(2):...
- ››Silverlight for Windows Phone 7开发系列(3):...
- ››Silverlight for Windows Phone 7开发系列(4):...
- ››Silverlight for Symbian
- ››Silverlight3系列(四)数据绑定 Data Binding 1
- ››silverlight2 游戏 1 你能坚持多少秒
- 中查找“Silverlight(5) - 2.0控件之ListBox, MediaElement, MultiScaleImage, PasswordBox, ProgressBar, RadioButton”更多相关内容
- 中查找“Silverlight(5) - 2.0控件之ListBox, MediaElement, MultiScaleImage, PasswordBox, ProgressBar, RadioButton”更多相关内容
- 上一篇:Silverlight(6) - 2.0控件之ScrollViewer, Slider, StackPanel, TabControl, TextBlock, TextBox, ToggleButton
- 下一篇:Silverlight(4) - 2.0控件之DataGrid, DatePicker, Grid, GridSplitter, HyperlinkButton, Image
更多精彩
赞助商链接