首页 新闻 会员 周边

c# dataGridView延时加载,怎么办?

0
悬赏园豆:10 [已解决问题] 解决于 2022-12-09 14:17

我外行学了点儿c#,想写一个小工具,在一个DLL里加了一个带dataGridView的窗体:FormInformationBalloon

并且在DLL里写了个方法:
private void Send(string pFilePath)
{

        FormInformationBalloon fm = new FormInformationBalloon();
        fm.Show();
        string exePath = System.AppDomain.CurrentDomain.BaseDirectory;
        string textFile = Path.Combine(exePath, "textfile", pFilePath);
        using (Stream stream = File.OpenRead(textFile))
        {
            using (StreamReader reader = new StreamReader(stream, Encoding.UTF8))
            {
                string strLine;
                while ((strLine = reader.ReadLine()) != null)
                {
                    Thread.Sleep(600);
                    SendString(strLine);
                    Thread.Sleep(600);
                }

            }
        }

     }

现在的问题是 :FormInformationBalloon窗体倒是可以先显示出来,但是!:dataGridView1的数据却在 方法结束之后才呈现出来,如何解决?

钢的锅的主页 钢的锅 | 初学一级 | 园豆:10
提问于:2019-03-09 23:54
< >
分享
最佳答案
0

你可以把 fm.Show() 写在数据加载完成之后

收获园豆:10
三人乐乐 | 老鸟四级 |园豆:4819 | 2019-03-11 10:12
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册