CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: progressbars

  1. #1
    Guest

    progressbars

    how do you use progress bars in a form?


  2. #2
    Join Date
    May 1999
    Location
    Oxford UK
    Posts
    1,459

    Re: progressbars

    You start by adding the common controls to your VB toolbox. Next, place the control on your form.

    You then need to set properties of the ProgressBar - for instance, is it measuring a percentage complete or a maximum value ?

    A simple code example follows : place a progressbar (ProgressBar1) and a button (command1) on your form, and then paste in the following code :


    private Sub Command1_Click()
    '
    Dim lCount as Long
    '
    ProgressBar1.Max = 32768
    '
    for lCount = 1 to 32768
    ProgressBar1.Value = lCount
    If lCount Mod 1000 = 0 then
    DoEvents
    End If
    next
    '
    End Sub





    Chris Eastwood

    CodeGuru - the website for developers
    http://codeguru.developer.com/vb

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

Featured