It doesn't explain the difference between me.invoke or control.invoke
maybe it is the same... and did the same thing?
Main Topics
Browse All TopicsHi experts
i'm using a lot of delegate with threads for accessing control in the main thread
however, i would like to know if it is better to use
if ME.Invokerequired then
ME.begininvoke(...)
else...
=> i use this instruction when i need to modify more than one control
in the case that i need to only need to synchronize one control then i use :
if myListbox.InvokeRequired then
myListbox.BeginInvoke(...)
else
if myCheckBox.InvokeRequired then
myCheckBox.BeginInvoke(...
else
etc...
does it change something between the two methods ? (using ME.invoke or myControl.begininvoke)
Any explanations are welcome
ps : sorry for my english
Thank you,
Kind Regards.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
ALL controls run in the SAME UI thread so you can just check against the Form (ME) itself ONCE and then do all of the updates in the same block:
Private Sub Foo()
If Me.InvokeRequired Then
Me.Invoke(Foo) ' <--- not correct syntax: Recursively call Foo()
Else
' Update MULTIPLE controls in here:
myListBox...
myCheckBox...
mySomethingElse....
End If
End If
Thank you Idle_mind for your response
so if i understand :
Private Sub Foo()
If Me.InvokeRequired Then
Me.Invoke(Foo) ' <--- not correct syntax: Recursively call Foo()
Else
' Update MULTIPLE controls in here:
myListBox...
myCheckBox...
mySomethingElse....
End If
End If
is the same (performance level) as
(if i only want to update one control for example)
Private Sub Foo()
If myControl.InvokeRequired Then
myControl.Invoke(delegate.
Else
myControl. (update myControl here)
End If
End If
am i right?
Regards.
Business Accounts
Answer for Membership
by: sirahPosted on 2009-08-06 at 05:59:30ID: 25032701
please check this link,
en-us/libr ary/ms1717 28.aspx
1. http://msdn.microsoft.com/