04 2011 档案

摘要:一.如果是单纯的让其动起来只用在加载时: Duration duration = new Duration(TimeSpan.FromSeconds(10)); DoubleAnimation doubleanimation = new DoubleAnimation(100.0, duration);progbar.BeginAnimation(ProgressBar.ValueProperty, doubleanimation);二.如果要其与某项操作相关有两种思路:1. 添加定时器,在规定每过几毫秒做某项操作并让Progresspar的值自增。2. 将Progresspar的值绑定到某个 阅读全文
posted @ 2011-04-14 20:44 Laro 阅读(273) 评论(0) 推荐(0) 编辑
摘要:private System.Windows.Threading.DispatcherTimer dt =new DispatcherTimer(); dt.Interval = TimeSpan.FromMilliseconds(1000); dt.Tick +=new EventHandler(dt_Tick); dt.Start(); void dt_Tick(object sender, EventArgs e) { //要执行的任务 }//最后不要忘记了dt.Stop();... 阅读全文
posted @ 2011-04-14 09:04 Laro 阅读(2510) 评论(0) 推荐(0) 编辑
摘要:网上查了很多方法,基本都是自己写一个列,再用程序来填充这列的值为行号,太复杂了。其实有个简单的思路就可以用3行代码实现这个功能:当DataGrid加载行时,将自身的索引值加1不就是行号了吗?将这个值写入表头(行)就行了。 dataGrid.LoadingRow += new EventHandler<DataGridRowEventArgs>(dataGrid_LoadingRow); //添加行号 public void dataGrid_LoadingRow(object sender, DataGridRowEventArgs e) { e.Row.Header = e.Ro 阅读全文
posted @ 2011-04-04 23:15 Laro 阅读(4906) 评论(0) 推荐(2) 编辑