DispatcherTimer.Start Método

Definição

Inicia o DispatcherTimer.

public:
 void Start();
public void Start ();
member this.Start : unit -> unit
Public Sub Start ()

Exemplos

O exemplo a seguir cria um DispatcherTimer. Um novo DispatcherTimer objeto chamado dispatcherTimer é criado. O manipulador dispatcherTimer_Tick de eventos é adicionado ao Tick evento. O Interval é definido como 1 segundo usando um TimeSpan objeto .

//  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()

Comentários

Definir IsEnabled como false quando o temporizador é iniciado interrompe o temporizador.

Definir IsEnabled como true quando o temporizador é interrompido inicia o temporizador.

Start define IsEnabled como true.

Start redefine o temporizador Interval.

Aplica-se a