RT,我是用主窗体去打开一个子窗体,但是我启动调试的时候是不会弹出子窗体,但是我在debug的文件夹里面打开程序运行时就可以弹出子窗体,这是什么问题呃?求救啊。。都不知道怎么调试了。。

解决方案 »

  1.   

            void WatchPath()
            {
                while (true)
                {
                    try
                    {
                        OpenFilePath = Directory.GetFiles(newFilePath, "*.jmms");
                        Real_Time realtime = new Real_Time(OpenFilePath);
                        realtime.OpenFilePath = this.OpenFilePath;
                   
                        if (flag == true)
                        {                        //
                            flag = false;
                            realtime.ShowDialog();                    }
                        
                    }
                    catch
                    {
                        
                    }
                }
            }        private void button1_Click(object sender, EventArgs e)
            {
                //timer1.Enabled = true;
                flag = true;
               // this.Hide();
                Thread wp = new Thread(threadwatchpath);
                wp.IsBackground = true;
                wp.Start();
                
                
            }
    求救啊
      

  2.   


    我真看不出什么问题啊。就是在bin文件夹里面打开的程序就是可以打开子窗体的,然后调试的时候是不能打开子窗体的,也什么提示都没有
      

  3.   

    除了这个,没发现导致你那原因的代码
    threadwatchpath  what??还有这个?为什么用构造函数初始化realtime.OpenFilePath属性还要在下面赋值呢?多余了
    Real_Time realtime = new Real_Time(OpenFilePath);
    realtime.OpenFilePath = this.OpenFilePath;
      

  4.   


    因为我是要在窗体间传递数据的,然后那个threadwatchpath 搞错了,刚刚忘记改了,这个不影响,因为之前是Thread wp = new Thread( WatchPath);,然后这个也是调试的时候没办法弹窗的
      

  5.   


    我发现要是我改用timer的话就可以弹窗,要是用线程就不行喔这是什么情况