How to pass function as parameter
<p>Ok, I already passing function as parameter to another function like this:</p>

<pre><code>someFunction(..., passFunc);
passFunc(){ MessageBox.Show("Message"); }
private void someFunction(..., Func&lt;int&gt; f) { f(); }
</code></pre>

<p>This works just fine. I pass "passFunc" to "someFunction" as parameter and then call this parameter("f()"). Then I got messagebox with text "message". Ok.</p>

<p>In later version of program, function "passFunc" is called when I click on specific button's...
Then I wish to get text. I normally do this so: <code>((Button)sender).Text;</code>. But in this case I cant do this, because I have no parameters in this "passFunc".</p>

<p>How can I do this? So, that "passFunc" will look like: <code>passFunc(object sender, EventArgs e)</code></p>

<p>Then I'll be able to do this:</p>

<pre><code>passFunc(object sender, EventArgs e)
{
    MessageBox.Show(((Button)sender).Text);
}
</code></pre>

<p>here is code: <a href="http://pastie.org/6079188" rel="nofollow">http://pastie.org/6079188</a></p>
