DispatcherTimer.Start Metode
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
DispatcherTimerMemulai .
public:
void Start();
public void Start ();
member this.Start : unit -> unit
Public Sub Start ()
Contoh
Contoh berikut membuat sebuah DispatcherTimer. Objek baru DispatcherTimer bernama dispatcherTimer
dibuat. Penanganan aktivitas dispatcherTimer_Tick
ditambahkan ke Tick peristiwa.
Interval diatur ke 1 detik menggunakan TimeSpan objek .
// DispatcherTimer setup
dispatcherTimer = new System.Windows.Threading.DispatcherTimer();
dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick);
dispatcherTimer.Interval = TimeSpan.FromSeconds(1);
dispatcherTimer.Start();
' DispatcherTimer setup
dispatcherTimer = New Threading.DispatcherTimer()
AddHandler dispatcherTimer.Tick, AddressOf dispatcherTimer_Tick
dispatcherTimer.Interval = New TimeSpan(0,0,1)
dispatcherTimer.Start()
Keterangan
Pengaturan IsEnabled ke false
ketika timer dimulai menghentikan timer.
Pengaturan IsEnabled ke true
ketika timer dihentikan memulai timer.
Start
IsEnabled diatur ke true
.
Start mengatur ulang timer Interval.