Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8308847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:55:43+00:00 2026-06-08T18:55:43+00:00

question: Can i perform a flush like function to a richtextbox? reason: I am

  • 0

question:

Can i perform a flush like function to a richtextbox?

reason:

I am writing ~20-40 lines of text at a time to a richtextbox using a loop, my issue is that the whole GUI freezes during that time and nothing can be seen until everything has been written to the richtextbox and the code moves on. I want to write each line to the screen immediately if possible to avoid freezing. I know in console i can use a aFileStream.Flush() command to perform this function. Is there a similar function for aFileStream.appendtext()? My googleFu is weak today and i cant find any examples of this online. Any help is appreciated.

sample code:

 foreach (string fullPath in appDataDirectories)
                {
                    //update progess bar
                    progresbarupdate();
                    //split file path in to parts
                    string[] folders = fullPath.Split('\\');
                    //print out create time for directory
                    DateTime creationTimeUtc = Directory.GetCreationTimeUtc(fullPath);
                    String ctime = creationTimeUtc.ToString();
                    //create String
                    String printable = String.Format("{0,-50}\t{1}", ctime, fullPath);
                    output.AppendText(printable + "\n");
                }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T18:55:46+00:00Added an answer on June 8, 2026 at 6:55 pm

    I don’t think so you will be able to achieve the unfreezing of the RichTextBox by a flush

    You can use the BackgroundWorker to do some work in the background on a separate thread and then invoke the Text action of the RichTextBox

    Please see my example that shows the RichTextBox does not freeze

    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
    
        private void button1_Click(object sender, EventArgs e)
        {
            BackgroundWorker bg = new BackgroundWorker();
            bg.DoWork += new DoWorkEventHandler(bg_DoWork);
            bg.RunWorkerAsync();
        }
    
        void bg_DoWork(object sender, DoWorkEventArgs e)
        {
            for (int i = 0; i < 1000000000; i++)
            {
                Action action = () => richTextBox1.Text += "Line Number " + i;
                richTextBox1.Invoke(action); 
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Extremely basic question. Are there common actions I can perform using keyboard shortcuts in
Earlier, I asked this question: How can I perform a ping or traceroute using
I am writing a JavaScript function that can perform decimal place manipulation on a
I am using the jQuery-File-Upload widget (although I believe this question can generalize to
Question Can I style just a part of a single character? Meaning CSS attributes
Short Question: Can I specify wildcards for custom console folding? If so, what is
My question can be boiled down to, where does the string returned from stringstream.str().c_str()
Short question: Can anyone tell me what the requirements (especially when it comes to
My original question can be found here , for which I've gotten some great
I know this question can be answered by searching in google. But I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.