DispatcherTimer.Start Método
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Inicia el DispatcherTimer.
public:
void Start();
public void Start();
member this.Start : unit -> unit
Public Sub Start ()
Ejemplos
En el ejemplo siguiente se crea un DispatcherTimer. Se crea un nuevo DispatcherTimer objeto denominado dispatcherTimer . El controlador dispatcherTimer_Tick de eventos se agrega al Tick evento.
Interval se establece en 1 segundo mediante un 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()
Comentarios
Al establecer IsEnabled en false cuando se inicia el temporizador, se detiene el temporizador.
Al establecer IsEnabled en true cuando se detiene el temporizador, se inicia el temporizador.
Start establece IsEnabled en true.
Start restablece el temporizador Interval.