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 6245635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T12:32:28+00:00 2026-05-24T12:32:28+00:00

I’m currently writing a lightweight program that consolidates many command line and other external

  • 0

I’m currently writing a lightweight program that consolidates many command line and other external processes into one application.

Currently, I am faced with the challenge of pulling system information using the system info process.

I have successfully coded the button to call the system info process, and redirect the output to a text field.

What I am now attempting is to have a progress bar at the bottom of my WPF window, since it takes a moment to load the system information.

Since I don’t know of a way to get an accurate duration from an external process, I am attempting to use the Marquee style.

I’ve been following examples here on stackoverflow (Windows Forms ProgressBar: Easiest way to start/stop marquee?), as well as other sites, but haven’t been able to determine where to put the code so that the progress bar scrolls while systeminfo is running and stops when it is finished.

My current code (without the progressbar1.Style = ProgressBarStyle.Marquee;) is below.

Any suggestions as to where to place the code, or what syntax to use would be greatly appreciated. Thank you in advance!

private void btnSystemInfo_Click(object sender, RoutedEventArgs e)
        {


            // Get system info
            Process info = new Process();
            info.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
            info.StartInfo.FileName = "C:\\Windows\\system32\\systeminfo.exe";
            info.StartInfo.Arguments = "-S " + context;
            info.StartInfo.UseShellExecute = false;
            info.StartInfo.CreateNoWindow = true;
            info.StartInfo.RedirectStandardOutput = true;

            info.Start();

            string infoOutput = info.StandardOutput.ReadToEnd();
            info.WaitForExit();

            // Write to the txtInfo text box
            txtInfo.Text = "System Info: " + infoOutput;
            txtInfo.Foreground = Brushes.Black;
            txtInfo.VerticalScrollBarVisibility = ScrollBarVisibility.Visible;

            // Switch to the info tab
            tabControl.SelectedIndex = 3;
        }
  • 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-05-24T12:32:29+00:00Added an answer on May 24, 2026 at 12:32 pm

    What you need to do is move the code that gathers system information in the BackgroundWorker thread and in main UI thread start a marquee. Once you get the signal from BackgroundWorker thread that it’s work has complete, stop the marquee and display the information in the textBox

    void ButtonClickEvent()
    {
        BackgroundWorker bg = new BackgroundWorker();
        bg.DoWork += new DoWorkEventHandler(MethodToGetInfo);
        bg.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bg_RunWorkerCompleted);
        //show marquee here
        bg.RunWorkerAsync();
    }
    
    void MethodToGetInfo(Object sender, DoWorkEventArgs args)
    {
        // find system info here
    }
    
    void bg_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs args)
    {
        //this method will be called once background worker has completed it's task
        //hide the marquee
        //update the textbox
    
        //NOTE that this is not a UI thread so you will need BeginInvoke to execute something in the UI thread
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am currently running into a problem where an element is coming back from
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace
I want use html5's new tag to play a wav file (currently only supported
I need a function that will clean a strings' special characters. I do NOT

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.