I’m trying to do the following:
I have a form1 with a textBox and the following method:
public void ChangeText()
{
textBox.Text = "A";
}
The application runs a form of class Form1 – We’ll call it mainForm.
That main form starts another process that creates another form of class Form1 – Let’s call it childForm.
I now want to click a button on mainForm and have the childForm’s ChangeText() method called so that the childForm’s textBox is the one that is effected.
I’ve been looking for a while and I can’t seem to make it work. I’m not entirely sure it’s even possible.
API doesn’t seem to give me the option at all and with WCF the method is being called, but the original form is not recognized.
Sure, it’s possible, but since the two forms are in different processes, you’ll need an inter-process communication (IPC) mechanism like .NET Remoting or Windows Communication Foundation. Or you can use this technique.