Advertisement

04.23.2008 at 02:12PM PDT, ID: 23348379
[x]
Attachment Details

Opening a form called from a thread in c#.net 2008

Asked by wademi in Microsoft Visual C#.Net, Microsoft Visual C++.Net, Visual Studio 2008

I am using  a thread to open a form in my c#.net application. The problem is the form opens and hangs(A blank white screen). The form does not load the code I have in the startup section of the form. If I open the form from for example a button_Click it opens and does the code in the startup. The form seems to have a problem when opened from a thread
The code is as follows:
Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
private void startCallMonitorToolStripMenuItem_Click(object sender, EventArgs e)
        {
            
            Thread trd = new Thread(new ThreadStart(this.newcallcheck));
           
            trd.IsBackground = true;
            trd.Start();
                  
        }
 
     private void newcallcheck()
            {
               
              while (true)
               {
                    
 
                   if (ac.checkNewCalls(ac.getuser()) > 0)
                    {
 
                        NewCall fms = new NewCall();
                        fms.Show();
                        Thread.Sleep(25000);
                     
                        
                    }
                    else
                        Thread.Sleep(28000);
               }
 
            }
 
fms is the form that should open
[+][-]04.23.2008 at 02:33PM PDT, ID: 21425651

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Visual C#.Net, Microsoft Visual C++.Net, Visual Studio 2008
Sign Up Now!
Solution Provided By: ebyrne
Participating Experts: 2
Solution Grade: A
 
 
[+][-]04.23.2008 at 02:38PM PDT, ID: 21425687

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.23.2008 at 03:10PM PDT, ID: 21425970

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.23.2008 at 03:18PM PDT, ID: 21426032

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.23.2008 at 03:28PM PDT, ID: 21426123

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628