Results 1 to 6 of 6

Thread: [RESOLVED] Getting Value Of Progress Bar

  1. #1

    Thread Starter
    Lively Member CoderKid's Avatar
    Join Date
    Oct 2011
    Location
    In the middle of nowhere
    Posts
    72

    Resolved [RESOLVED] Getting Value Of Progress Bar

    Hi everyone, I'm stuck on a progress bar problem. I just wanted to know how I would go about getting the value of a progress bar, and converting it to a string to display in a label.
    I am doing a task with the progressbar, and I wanted to know how to get the value of the progress bar, and display it in a label above of it.

    I thought :

    Code:
    TextBox1.Text = ProgressBar1.Value.ToString()
    But I get an error.

    Any thoughts?
    <-- If you like my post, click on the to the left! It only takes a second...

  2. #2
    Master Of Orion ForumAccount's Avatar
    Join Date
    Jan 2009
    Location
    Canada
    Posts
    2,802

    Re: Getting Value Of Progress Bar

    What is the error? If you get an error that is relevant to your question, always post the message. The stack trace also helps.

  3. #3

    Thread Starter
    Lively Member CoderKid's Avatar
    Join Date
    Oct 2011
    Location
    In the middle of nowhere
    Posts
    72

    Re: Getting Value Of Progress Bar

    Sorry...I didn't explain myself well. It wasn't an error that stopped the program and highlighted that line of text, it's just that Label1's text stayed at 0 the entire time the Progress Bar was loading. So, it was an error in my code obviously, but the program can still run.

    Sorry for not explaining myself!
    <-- If you like my post, click on the to the left! It only takes a second...

  4. #4
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Getting Value Of Progress Bar

    there is no error in your code... if there was you would get an exception. the problem is in your logic or thinking... unless that line of code is in a loop or something that runs on a regular basis, it's never going to up date... also, it's possible that it is updating, but UI updates are low on the priority level, so the screen may not be actually updating. If the code isn't in a loop, move it into the same loop where you're advancing the progress bar... if it's already there, you can force the textbox to update by invalidating it (textbox1.invalidate ... I think that's right... also ... is there a reason for using a textbox instead of something like a label?

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  5. #5

    Thread Starter
    Lively Member CoderKid's Avatar
    Join Date
    Oct 2011
    Location
    In the middle of nowhere
    Posts
    72

    Re: Getting Value Of Progress Bar

    Well actually, now that I think about it, I should use a label. This time, I'll try and move the code around in a different spot. I'll tell you how it works.
    <-- If you like my post, click on the to the left! It only takes a second...

  6. #6

    Thread Starter
    Lively Member CoderKid's Avatar
    Join Date
    Oct 2011
    Location
    In the middle of nowhere
    Posts
    72

    Re: Getting Value Of Progress Bar

    Good news...it works! Thanks so much for all of your guys help! Have a good day!
    <-- If you like my post, click on the to the left! It only takes a second...

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