In my project i need to pop up a form with progressbar while i am populating a treeview from xml file in another form,
i used progress.show() function before parsing a xmlfile
(progress is a instance of below shown class)
progress bar is running after populating a treeview
can anybody suggest in this regard plz?
i have created a usercontrol with progress bar with label to show a % done
what should i do?
here is the code inside a progressbarform
plz help me
Expand|Select|Wrap|Line Numbers
- public partial class ProgressBarForm : Form
- {
- public ProgressBarForm()
- {
- InitializeComponent();
- }
- private void ProgressBarForm_Load(object sender, EventArgs e)
- {
- timer1.Enabled = false;
- progress1.Value = 0;
- progress1.Maximum = 20;
- progress1.Step = 1;
- timer1.Enabled = true;
- }
- private void timer1_Tick(object sender, EventArgs e)
- {
- progress1.PerformStep();
- if (progress1.Maximum == progress1.Value)
- {
- timer1.Enabled = false;
- }
- }
- }
- }
- }