Results 1 to 7 of 7

Thread: Progress Bars

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2000
    Location
    Manchester, UK
    Posts
    50

    Cool

    Hi there

    Does anyone know how to create a progress bar that is completly solid instaed of the normal one which is in blocks? I mean something like the one you get when installing most apps.

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Do you mean to create a new control or to use one?
    I believe kinjalgp have done one earlier, you could ask him.
    For creating your own ActiveX OCX:
    Code:
    line(0,0)-(scalewidth*progress,scaleheight),forecolor,BF
    Where progress is a value between 0 and 1
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3

    Thread Starter
    Member
    Join Date
    Jun 2000
    Location
    Manchester, UK
    Posts
    50

    Cool Thats fine, but

    Thanks kedaman, that's fine but is there no way of using the Windows API progress bar to change the style of it (I know how to change the colour, for example)

  4. #4
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    AFAIK you cannot do that using windows api, but of course, progressbars are such easy things to do i.e you could do it with a simple picturebox, so why bother using api?
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  5. #5
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238

    Thumbs up Create your own color ProgressBar

    Juz take a look on this thread

  6. #6
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    // example

    'example of a progress bar using a picture box

    'make a standard app and add a picture box called Progress
    'in the PublicSub DoProgress..rename the frmSaveApps to your form name
    'cut and paste the code and run to see an example
    '
    '<<<<<<< Put this in a bas module >>>>>>>>

    'replace frmTips with the name of your app form
    'or name your form frmTips for this example

    Option Explicit

    'number of things to do ex..files to be backed up
    Public intCounted#
    '
    Public Sub DoProgress(Percent)
    '
    ' Percent is % of graph
    '
    Dim Work As Integer
    Dim Num As String
    '
    Work = Int(Abs(Percent))
    If Work > 100 Then Work = 100
    '
    With frmSaveTips.Progress '<<< With application form
    .BackColor = vbWhite '<<< White background
    If Not .AutoRedraw Then '<<< picture in memory ?
    .AutoRedraw = True '<<< make one
    End If

    .Cls '<<< clear picture in memory
    .ScaleWidth = 100 '<<< new scalemodus
    .DrawMode = 10 '<<< not XOR Pen Modus

    Num = Format$(Work, "###") + "% Completed"

    .CurrentX = 50 - .TextWidth(Num) / 2 '<<< %age is Centered

    .CurrentY = (.ScaleHeight - .TextHeight(Num)) / 2

    frmSaveTips.Progress.ForeColor = vbBlack '<<< Black text
    frmSaveTips.Progress.Print Num '<<< print percent

    frmSaveTips.Progress.Line (0, 0)-(Work, .ScaleHeight), vbBlue, BF
    .Refresh '<<< show
    End With
    '
    End Sub
    '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

    ' <<<<<<<<<<<< event code for form >>>>>>>>>>>>>>>>>>>

    Private Sub Command1_Click()

    intTotalCount = 1000 'whatever..use 1000 for this example

    'print the line & increment the count

    Dim i, copied

    For i = 1 To 1000

    Print "This is a progress bar sample!"

    copied = copied + 1 'increment for progress bar
    Call DoProgress(copied / intTotalCount * 100) 'progress bar set to 100
    Next i

    End Sub
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  7. #7
    Fanatic Member
    Join Date
    Oct 1999
    Location
    MA, USA
    Posts
    523
    Why won't you just change the Scrolling property to 1-ccScrollingSmooth?

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