#眉標=VS2008、WPF、XAML #副標=體驗新一代整合開發環境(9) #大標=WPF與新世代使用者操作介面設計(下) #作者=文/圖 王寧疆 ===<反灰>============= xmlns:igWindows="http://infragistics.com/Windows" xmlns:igDP="http://infragistics.com/DataPresenter" xmlns:igEditors="http://infragistics.com/Editors" xmlns:igDock="http://infragistics.com/DockManager" ================ ===<反灰>============= ================ ===<反灰>============= Infragistics3.Wpf.DataPresenter.v8.1.Express.dll Infragistics3.Wpf.Editors.v8.1.Express.dll Infragistics3.Wpf.v8.1.Express.dll ================ ===<反灰>============= ================ ===<反灰>============= ================ ===<反灰>============= ================ ===<反灰>============= ================ ===<反灰>============= private DispatcherTimer timer; ================ ===<反灰>============= private void Go_Click(object sender, RoutedEventArgs e) { timer = new DispatcherTimer(); //建立DispatcherTimer timer.IsEnabled = true; //啟用DispatcherTimer timer.Interval = new TimeSpan(0, 0, 1); //設定每秒鐘通知應用程式 timer.Tick += new EventHandler(timer_Tick); //處理DispatcherTimer的Tick事件 } ================ ===<反灰>============= void timer_Tick(object sender, EventArgs e) {   if (Needle.Value < 100) //儀表板指針尚未指到100時 { Needle.Value += 10; //令指針指到的數字加10 } else { timer.IsEnabled = false; //禁用DispatcherTimer } } ================ ===<反灰>============= ================ ===<反灰>============= string strConn = "Data Source=.;Initial Catalog=Northwind;Integrated Security=true"; //資料庫連線資訊 string strSQL = "Select * from Customers"; //查詢客戶資訊 SqlDataAdapter da = new SqlDataAdapter(strSQL, strConn); //建立SqlDataAdapter DataSet ds = new DataSet(); //建立DataSet da.Fill(ds); //執行並將查詢的結果存放到DataSet CustomerGrid.ItemsSource = ds.Tables[0].DefaultView; //將客戶資訊交給DataGridControl顯示 ================ ===<反灰>=============           ================ ===<反灰>=============     請放入更多的圖片   ================