Windows Develop Bookmark and Share   
 index > Windows Forms General > how to program a simple progress bar ????? 100% hardcore questions
 

how to program a simple progress bar ????? 100% hardcore questions

I am trying to program the progress bar to load in a full bar instead of blocks.
i have change the style to continuous but still it load in blocks.
I am trying to program the progress bar to load according to what value i type in the textbox , i have set its maximum value to be 2000
This is the code i have written... See if the way i program got error which causes it to load in blocks..:

private

void txtDataReceived_TextChanged(object sender, EventArgs e)

{

int Counter = Convert.ToInt32(txtDataReceived.Text);

this.progressBar1.Maximum = 2000;

this.progressBar1.Minimum = 0;

this.progressBar1.Value = Convert.ToInt32(Counter);

}

  • Moved byWesley YaoMSFTWednesday, September 30, 2009 3:29 AMwinform question (From:Visual Studio Source Control and SourceSafe)
  •  
Heri Tony  Tuesday, September 29, 2009 2:58 AM
Hi Heri,

You do not need to set Maximum and Minimum properties of ProgressBar each time the TextChanged event of TextBox fired. You just need to set them when the form is loaded. When the value between maximum and minimum reaches 2000, I think the progressbar should perform smoothly. But your code will result in block effect. For example, if I enter 10, then I change it to 11; I need to delete 0 and press 1, the progressbar’s value will turn to 1 and then turn to 11. So you’d better use NumericUpDown control instead.

If I misunderstood you, please feel free to tell me.

Sincerely,
Kira Qian
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework!
Kira Qian  Thursday, October 01, 2009 7:21 AM
I think Heri wants a Vista-styled progress bar in a Windows XP environment.  XP progress bars are block-based, while Vista progress bars are continuous.

If this is the case, you'll need to create your own progress bar because simply put, Windows XP does not provide a continuous progress bar (to the best of my knowledge).
MCP
webJose  Friday, October 02, 2009 7:11 AM
The OP has posted this same question in what seems dozens of forums.  Answer is here.   Works on XP too.

Hans Passant.
nobugz  Friday, October 02, 2009 9:00 AM

You can use google to search for other answers

Custom Search

More Threads

• MenuStrip with ToolStripTextBox
• Reloading MDI Container
• Referencing classes on secondary forms versus singleton
• Pick DataGrid column value
• draw circle ,rectangle over image and also want to relocate it at image anywhere using c#
• System.Forms.Media
• Finding character count at first time
• Binding ComboBox to BindingList Problem
• Fill the Combobox
• never throw WM_NCLBUTTONDOWN