How translate it in C#?

  • Thread starter Thread starter PL
  • Start date Start date
P

PL

I want to translate this VB statement to C#:

Me.Invoke(CType(AddressOf Me.AddTextToTextBox, MethodInvoker))

What is the equivalent in C#?
 
PL,

You would do this:

this.Invoke(new MethodInvoker(AddTextToTextBox));

In .NET 2.0, you will be able to do just this:

this.Invoke(AddTextToTextBox);

Hope this helps.
 
And it does! Thank you!

Nicholas Paldino said:
PL,

You would do this:

this.Invoke(new MethodInvoker(AddTextToTextBox));

In .NET 2.0, you will be able to do just this:

this.Invoke(AddTextToTextBox);

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

PL said:
I want to translate this VB statement to C#:

Me.Invoke(CType(AddressOf Me.AddTextToTextBox, MethodInvoker))

What is the equivalent in C#?
 

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