I assume you have Form1 as main form in "Client Side".
Code for Form1 "Client Side"
private void Form1_Load(object sender, EventArgs e)
{
System.Threading.ThreadPool.QueueUserWorkItem(new System.Threading.WaitCallback(this.ShowForm2));
}
private void ShowForm2(object state)
{
var hWait = new System.Threading.EventWaitHandle(false, System.Threading.EventResetMode.ManualReset, "Global\\Form2Show");
while (true){
hWait.WaitOne();
Form2 f = new Form2();
this.Invoke(new System.Threading.ThreadStart(f.Show));
hWait.Reset();
}
}
Code for "Server Side" (when button pressed)
private void buttonOpenForm_Click(object sender, EventArgs e)
{
System.Threading.EventWaitHandle.OpenExisting("Global\\Form2Show").Set();
}
EDIT: according to OP reply "Other question in this project is, I used text files to store the data, I have to store them in Server side of programm. Client side of programm it needs those data to fill the form using Sockets."
Have a look
here.