Solved

Progress Bar In VB6

Posted on 2004-08-15
7
847 Views
Last Modified: 2013-12-25
I thought I could do this, but dont know the code or the property I need to look at.

Is there any way to turn the standard Progress Bar into a solid bar ?

Does this increase the resolution of the bar or does it just join the boxes that are in the standard bar ?

Kind Regards
Mike Marriott
0
Comment
Question by:adammyers
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 11804215
There is no property to make the standard Progress Bar solid.

It is very easy to write your own Progress Bar though using a PictureBox.  The example below allows you to also have your own custom text inside the progress bar.

Create a new project and add a long thin PictureBox about the size as a Progess Bar and one CommandButton:

Option Explicit

Private Sub Form_Load()
    Picture1.AutoRedraw = True
    Picture1.BackColor = vbWhite
    Picture1.ForeColor = vbBlue
    Picture1.ScaleWidth = 100
    Picture1.DrawMode = vbNotXorPen
End Sub

Private Sub Command1_Click()
    Dim i As Integer
    Dim f As Integer
    Dim m As String
     
    f = 10000
    For i = 1 To f
        m = "Processing File " & i & " of " & f
        updateProgressBar m, i, f
        DoEvents
    Next i
End Sub

Private Sub updateProgressBar(ByVal msg As String, ByVal value As Integer, ByVal max As Integer)
    Dim p As Integer
   
    Picture1.Cls
    Picture1.CurrentX = (Picture1.ScaleWidth - Picture1.TextWidth(msg)) \ 2
    Picture1.CurrentY = (Picture1.ScaleHeight - Picture1.TextHeight(msg)) \ 2
    Picture1.Print msg
    p = Int(value / max * 100)
    Picture1.Line (0, 0)-(p, Picture1.ScaleHeight), Picture1.ForeColor, BF
End Sub

0
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 11805614
Actually there is a property to make the standard scrollbar solid. Its the "Scolling" property, it has two settings (ccScrollingStandard and ccScrollingSmooth).

ccScrollingStandard uses the individual blocks.
ccScrollingSmooth uses a solid contiuous line.

Hope this helps.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 11805716
I stand corrected.

Thank you carl_tawn.

Idle_Mind
0
 

Author Comment

by:adammyers
ID: 11808664
Running VB6 SP5, I have the following properties for the progress bar;
(About)
(Custom)
(Name)
Align
Appearance
BorderStyle
DragIcon
DragMode
Enabled
Height
Index
Left
Max
Min
MouseIcon
MousePointer
Negotiate
OLEDropMode
TabIndex
Tag
ToolTipText
Top
Visible
WhatsThisHelpID
Width

I can find where I need to set the property,

If I use

ProgressBar1.Scroll = ccScrollingSmooth

I just get an error when I run the program.

Regards
Mike
0
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 475 total points
ID: 11808723
Which library are you getting the progress bar from ?  From the looks of it your using a version from an older library than the one you should be using.

The on you should be using resides in "Microsoft Windows Common Controls 6.0"
0
 

Author Comment

by:adammyers
ID: 11808745
Bingo,

I Was using 5.0 !

Thanks !
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month9 days, 17 hours left to enroll

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question