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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T11:55:55+00:00 2026-06-03T11:55:55+00:00

My winform has a progress bar which should increase based on the number of

  • 0

My winform has a progress bar which should increase based on the number of files the program is processing. it works fine on one box (win xp) but not the other(winserver 2008). The bar is not filled fully by the time the process ends. Both have the same .net framework 3.5

private void data_process()
    {
        int progress_num = (100/checkedListBox1.Items.Count);
        .......
         progressBar1.Value = progressBar1.Value + progress_num;}

do you know why? and do you have better solution?

——this is the new code

private void button1_Click(object sender, EventArgs e)
{
        progressBar1.Value = 0;
        richTextBox1.Clear();
        richTextBox1.Focus();
        if (checkedListBox1.CheckedItems.Count < 1)
        {
            MessageBox.Show("No file is selected", "Warning");

        }

        else
        {
            if ((region != null) && (venue != null) && (lhversion != null) && (release_version != null) && (desc != null))
            {
                progressBar1.Maximum = checkedListBox1.Items.Count + 3;
                progressBar1.Step = 1;
                //progressBar1.Value = progressBar1.Value + 10;
                progressBar1.PerformStep();
                login();
                //progressBar1.Value = progressBar1.Value + 10;
                progressBar1.PerformStep();
                data_process();
                //progressBar1.Value = progressBar1.Value + 10;
                progressBar1.PerformStep();
                if (user_in == true)
                {
                    richTextBox1.SelectionColor = Color.Blue; 
                    richTextBox1.AppendText("Done");
                }
            }

 private void data_process()
 {
            string line;
            //int progress_num = (70/checkedListBox1.Items.Count);

            foreach (object itemChecked in checkedListBox1.CheckedItems) // for each selected file
            {
                  ...
                  progressBar1.PerformStep();
            }
}
  • 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-03T11:55:56+00:00Added an answer on June 3, 2026 at 11:55 am

    I will try to use the native command to increment the progress bar without calculating the increment
    (what happens when the items are > 100?)

    progressBar1.Maximum = checkedListBox1.Items.Count;
    progressBar1.Step = 1;
    ...
    progressBar1.PerformStep();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a winform application which has a dynamic number (based on a database
I have a Winform DataGridView , which has a number of predefined columns. Now
I have WinForm which is a tab based and including all Tabs it has
I have a winform form which has typical OK and Cancel buttons. The OK
I've got a WinForm which has a TextBox . I've wired up the KeyPress
I have a winform application and this winform application has created few files. I
I tempted to apply skin to my winform application which has many datagrids. Many
i have this situation, i have a winform which has arround 10 to 15
I have a userControl11 (either in winform or wpf) which has a ValueChanged custom
My company has an existing established WinForm application which in running on WinXP. The

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.