|
-
Feb 7th, 2013, 12:26 PM
#6
Hyperactive Member
Re: Threading & Accessing controls repeatidly.
 Originally Posted by kayleigh
Well thats my worry resolved
Code:
Private Sub UpdateInterface(ByVal sender As Object, ByVal e As EventArgs) Handles Me.SomeThingChnaged
If Me.StatusTextBox.InvokeRequired Then
Me.StatusTextBox.Invoke(New Action(Of Object, EventArgs)(AddressOf UpdateInterface), sender, e)
Quick note on the invoke though. Am i using the action delegate correctly since i am passing a custom event(Of T
There is nothing wrong with the use of the action delegate, you could just as easily use a anonymous method, but that is mostly up to the programmer.
Does that code execute? I would have to look it up, but I thought Invoke took and array of objects rather than multiple parameters like you have defined, but like I said, I would have to look at msdn again to make sure.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|