Results 1 to 5 of 5

Thread: [RESOLVED] Progress Bar Help

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2006
    Location
    USA
    Posts
    122

    Resolved [RESOLVED] Progress Bar Help

    Hi Everyone.

    I have a progress bar on a form. I want to have a continous progress bar while an operation is being performed. I would like to tie this to a button click event. I have posted the code below. Please let me know what i am doing wrong.

    Button Code:
    1. private void btnFindLabels_Click(object sender, EventArgs e)
    2.         {
    3.            
    4.            
    5.             this.ProgressBar.Style = ProgressBarStyle.Marquee;
    6.             this.ProgressBar.MarqueeAnimationSpeed = 100;
    7.  
    8.             //this.ProgressBar.Maximum = myfile.Length;
    9.             //this.ProgressBar.Minimum = 1;
    10.             //this.ProgressBar.Step = (myfile.Length / 100);
    11.            
    12.          
    13.         }

    Thanks in advance

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Progress Bar Help

    And what happens when you click this button?
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Oct 2006
    Location
    USA
    Posts
    122

    Re: Progress Bar Help

    nothing.....no action at all happens

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Progress Bar Help

    Have you placed a breakpoint on that method? Does it actually get executed? The same code works perfectly for me, assuming that you have a ProgressBar named "ProgressBar" (which is not a very good name by the way) and that that method is handling the Click event of the appropriate Button.

    Also, you shouldn't be setting the MarqueeAnimationSpeed in code unless you specifically want to change it. Normally you'd set that in the designer and just leave it. Always set the appropriate initial property values in the designer if you know them at design time and only set them in code if you specifically need to change them from that initial value.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Oct 2006
    Location
    USA
    Posts
    122

    Re: Progress Bar Help

    jmcilhinney,

    Thanks for all the great advice. I realize my naming scheme was the best you could do. However this issue i figured out was that I was doing quite a bit of processing. I have used a background worker and everything seems to be working fine.

    thanks for all the help

    -zd

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width