Click here to Skip to main content
15,891,431 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have designed a IP Softphone using C# Winforms..
Now, I want to add XMPP Chat also with it... But, Main thread already has lot of task to do,,,
So I have made a new thread and inside it I start the form... For the main thread to communicate with the form, I declared it as static outside of thread... My code look like this now,,,

C#
public static XMPPForm xform = null ;
[STAThread]
     static void Main(string[] args)
     {
         Thread thr = new Thread(delegate ()
             {
                 tf = new XMPPForm();
                 tf.ShowDialog();
             });
         thr.Start();
         if(tf != null && !tf.IsDisposed)
             tf.Label1.Text = "SomeText Here";

         // Starting the Main Form
     }



My Question is.... will it have any problem in this approch ??
Is it fine to go like this ??
This will include showing and hiding of the form from main UI also,,,
Posted
Updated 22-Oct-13 22:40pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900