Re: cross-thread UI updating?
- From: spacemarine@xxxxxxxxxxxxxx
- Date: 23 May 2007 15:50:58 -0700
On May 23, 4:41 pm, Tim Van Wassenhove <t...@xxxxxxxxxxxxxxxx> wrote:
Here is a pattern i very often see for thread-safe updates of the UI...
(Method defined in a class that derives from Form)
thanks, tim. but can you help me put this in context? for instance,
heres some pseudo code i have now:
SomeForm.vb
--------------
'bad, because GetMyData() is binding its data (from a thread) back to
the UI:
Private Sub SomeForm_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim getDataThread As Thread = New Thread(AddressOf GetMyData)
If Not getDataThread.ThreadState = Threading.ThreadState.Running
Then
getDataThread.IsBackground = True
getDataThread.Start()
End If
End Sub
....but im a bit in the dark as to how the .Invoke pattern works w/
this, how it ties back into my code. can you shed any light on this?
thanks!
sm
.
- References:
- cross-thread UI updating?
- From: spacemarine
- Re: cross-thread UI updating?
- From: Tim Van Wassenhove
- cross-thread UI updating?
- Prev by Date: ListBox SelectionMode None ??
- Next by Date: Re: Event Log
- Previous by thread: Re: cross-thread UI updating?
- Next by thread: Re: cross-thread UI updating?
- Index(es):
Relevant Pages
|