WEB开发网
开发学院图形图像Flash Silverlight(5) - 2.0控件之ListBox, MediaElemen... 阅读

Silverlight(5) - 2.0控件之ListBox, MediaElement, MultiScaleImage, PasswordBox, ProgressBar, RadioButton

 2008-11-14 11:50:48 来源:WEB开发网   
核心提示: ProgressBar.xaml.csusing System;using System.Collections.Generic;using System.Linq;using System.Net;using System.Windows;using System.Windows.Con

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();
    }
  }
}

上一页  1 2 3 4 5 6 7  下一页

Tags:Silverlight 控件 ListBox

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接