Here's my problem... I'm creating a Private Messaging system. I have the main form (Form1) and the private message screen (pm_screen), When I open the Private messaging screen, I wish to send data from this form back to the original. But have no idea how to write this. Here is the code for the btnSend event on the Private Message screen.
Message_Send = txtSend.Text.Trim();
Form1 frm1 = new Form1();
Invoke(new Form1._sendPM(frm1.sendPM), Message_Send);
When I try this, it returns an error stating that:
Object reference not set to an instance of an object
Or something along those lines. My guess is, it's because I'm starting a new instance of Form1 while an instance already exists. But I have no idea how to access this 'existing instance'. Do you more experienced programmers have any advice?
Thanks
EDIT (added send method) - Located in Form1
public delegate void _sendPM(string Send_Message);
public void sendPM(string Send_Message)
{
Server_Send("PM|" + Send_Message);
}