Tag Archives: invoke

Let a thread call a form’s methods in C#

When the user clicks the Start Thread button, this program runs a counter on a separate thread. Every second the counter updates the form’s Value variable. It then displays the thread’s number and the new Value in the ListBox at … Continue reading

Posted in algorithms, programs, system, threading | Tagged , , , , , , , , , , , , , , , , | Leave a comment

Invoke public methods by using their names in C#

You can use reflection to invoke public methods by using their names. The following code shows how the example program does this. // Invoke the method. private void btnInvoke_Click(object sender, EventArgs e) { try { Type this_type = this.GetType(); MethodInfo … Continue reading

Posted in classes, reflection | Tagged , , , , , , , , , | Leave a comment