Delegates??

  • Thread starter Thread starter AAAAA
  • Start date Start date
A

AAAAA

Hi guys

i would know in that case i must delegates ?
Please sent me a example.

Thanks
Regards,
Cesar
 
i would know in that case i must delegates ?
Please sent me a example.

Any time you add a handler for a UI event, e.g. Click.
Any time you use LINQ.
Any time you start a new thread.

Jon
 
AAAAA kirjoitti:
Hi guys

i would know in that case i must delegates ?
Please sent me a example.

Thanks
Regards,
Cesar
Yesterday I used Invoke on a ListBox to add a line to the box. The code
that asked the adding was running on a different thread to the box, so
I put the Add method inside a delegate.

((ListBox)this.obj).Invoke(
(MethodInvoker) delegate()
{
((ListBox)this.obj).AddItem(msg, 2, Color.Red);
}
);

(The Color.Red tells that "msg" is actually an error message and the
ListBox is used as a message log).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top