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.
Printable View
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.
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:
Where progress is a value between 0 and 1Code:line(0,0)-(scalewidth*progress,scaleheight),forecolor,BF
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)
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?
Juz take a look on this thread
'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
Why won't you just change the Scrolling property to 1-ccScrollingSmooth?