C#等待TextBox文本填充,然后继续

我的程序计算出一堆东西,将其显示在TextBox中,然后继续。我想对我的程序进行截屏,以确保它做出正确的计算和决策。但是,我的TextBox文本似乎总是落后。我该如何解决?

textBox26.Text = "HELLO";
            String input = File.ReadAllText(@"C:\XXXXXXXXXXXXXX\LOG.txt");
            int imageid = Convert.ToInt32(input) + 1;
            Bitmap bmp = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
            using (Graphics g = Graphics.FromImage(bmp))
            {
                g.CopyFromScreen(0, 0, 0, 0, Screen.PrimaryScreen.Bounds.Size);
                bmp.Save(@"C:\XXXXXXXXXXXXXX\" + imageid.ToString("D5") + ".png");  // saves the image
            }
            File.WriteAllText(@"C:\XXXXXXXXXXXXXX\LOG.txt", "" + imageid);

我的屏幕快照显示空白的TextBox。请帮忙