• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3598
  • Last Modified:

Progressbar Marquee Clear?

I'm starting and stopping a Marquee style progressbar using the code below.

Problem: The marquee stops wherever its at, not resetting back to its original unused state...

 private void Progressbar(int speed)
        {
            if (speed > 0)
            {
                progressBar.Enabled = true;
                progressBar.Minimum = 0;
                progressBar.Maximum = 100;
                progressBar.Style = ProgressBarStyle.Marquee;
                progressBar.MarqueeAnimationSpeed = speed;
            }
            else
            {
                progressBar.Refresh();
                progressBar.Style = ProgressBarStyle.Marquee;
                progressBar.MarqueeAnimationSpeed = speed;
                progressBar.Value = 0;
            }
        }      
0
kvnsdr
Asked:
kvnsdr
  • 4
  • 3
1 Solution
 
Bob LearnedCommented:
I would try setting the Style to something other than Marquee, until you need it.

Bob
0
 
kvnsdrAuthor Commented:
Not working, still just stops wherever its at.

0
 
kvnsdrAuthor Commented:
So far I simply create the progressbar visible=false, run it (visible=true), then make it visible=false again.

 else
            {
                progressBar.Refresh();
                progressBar.Style = ProgressBarStyle.Marquee;
                progressBar.MarqueeAnimationSpeed = speed;
                progressBar.Visible = false;
            }
        }      
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
Bob LearnedCommented:
Did you set the style to Blocks before setting the value to 0?

Bob
0
 
kvnsdrAuthor Commented:
I'll try that.......
0
 
Bob LearnedCommented:
Also, did you use Application.DoEvents anywhere?

Bob
0
 
kvnsdrAuthor Commented:
Yea, just tried it when I make the call:

Progressbar(100);
Application.DoEvents();

StartFileImportThread();
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now