Results 1 to 2 of 2

Thread: Help with progress bars required please

  1. #1
    Guest

    Question

    Hi..

    I'm pretty new to VB 5.0 (enterprise ed.)..I'm not a programmer but I can usually program VB to do things I want it to do...at the moment I'm trying to get a progress bar to display the progress of a password check on login...at the moment I'm cheating coz I don't know how to do it..I used the sample code from VB helpfiles on progress bars...it doesn't check the passwords with the progress bar properly since the array code simply demonstrates how to code progress bars..heres the code I cheated with so you see what I am on about;

    Dim Counter As Integer
    Dim Workarea(7000) As String
    ProgressBar1.Min = LBound(Workarea)
    ProgressBar1.Max = UBound(Workarea)
    ProgressBar1.Visible = True

    'Set the Progress's Value to Min.
    ProgressBar1.Value = ProgressBar1.Min

    'Loop through the array.
    For Counter = LBound(Workarea) To UBound(Workarea)
    'Set initial values for each item in the array.
    ------------------------------------------------------------
    ' frmLogin.Caption = "Verifying Password..."

    I tried to change the forms title here and it didn't do anything as for all code I try, ie..txtpassword.visible = false
    ------------------------------------------------------------

    Workarea(Counter) = "Initial value" & Counter
    ProgressBar1.Value = Counter

    Next Counter
    ProgressBar1.Visible = False
    ProgressBar1.Value = ProgressBar1.Min


    As you will agree this is sample to make the progress bar increase to its max size...what I'd like is for the password and username to actually be checked and for the bar to increase accordingly so it is working and not looking like its working..I tend to learn programming by playing but I don't understand alot of concepts..I can't get my head round arrays..I am nearly there but not quite...if you can suggest code please show me what you'd do...additionally, and probably because I'm cheating, the code I'm using along with the above code won't change the title of the form or display any lables or textboxes...it will neither hide anything either..please help because I do want to learn and I'm a willing learner with a thirst for VB knowledge...thank you

    Darren De Wilde [email protected]


  2. #2
    Frenzied Member Buzby's Avatar
    Join Date
    Jan 1999
    Location
    UK
    Posts
    1,670
    I don't know what the hell you are trying to achieve but you use the progress bar like this;

    ProgressBar1.Min=0
    ProgressBar1.Max=7000
    ProgressBar1.Value=0

    For Dummy=0 to 7000
    ProgressBar1.Value=Dummy

    [do other stuff]

    Next

    You may want to insert a DoEvents() command after the Form.Caption line and after the "For..." line - this will let the computer take a breath during the loops and may help the progress bar keep up.
    Also - there is no need to change the Form.Caption on each iteration of the loop..
    'Buzby'
    Visual Basic Developer
    "I'm moving to Theory. Everything works there."

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