DoEvents in WPF vb.net

If you need to refresh the screen after a task has been accomplished, this method is easy to implement: (Si necesita actualizar la pantalla luego de que una tarea fue ejecutada, este es un método fácil de hacerlo)

Public Shared Sub DoEvents(ByVal dispatch As Dispatcher)
dispatch.Invoke(New Action(AddressOf DoEventsHandler), DispatcherPriority.Background)
End Sub
 
Private Shared Sub DoEventsHandler()
End Sub

 to call this Method you can use:

label1.text="Starting process"
DoEvents(Application.Current.Dispatcher)

'Big process starting here
.
.
label1.text="Second process"
DoEvents(Application.Current.Dispatcher)
'Second Big process starts
.
.



Based on http://www.toove.com/archives/70

Comentarios

Entradas populares de este blog

2da Reeleccion del presidente Alvaro Uribe?

Windows 8 cerrar ventanas

Lo sentimos la aplicación Contactos se detuvo.