Avatar of CipherIS
CipherIS
Flag for United States of America

asked on 

C# Call Method on Form from Class

I have a form and a class.

The form calls the class.  

When the code is in the class I want the class to call a method on the form.

Below is sample code of what I'm trying to accomplish.
 private void Form1_Load(object sender, EventArgs e)
{
    this.CenterToScreen();
    InitSettings();

    ProcessClass pc = new ProcessClass();
    pc.BeginProcess();

}

public void ProcessChanged(int value);
{
    //Do Something;
}

public class FMCProcess
{
    public List<string> BeginProcess()
    {
        List<string> result = new List<string>();

        //I want to call ProcessChanged on Form1 here.

        return result;
    }
}

Open in new window

.NET ProgrammingC#

Avatar of undefined
Last Comment
Molnár István

8/22/2022 - Mon