Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old December 19th, 2005, 02:57 PM
Friend of Wrox
Points: 1,035, Level: 12
Points: 1,035, Level: 12 Points: 1,035, Level: 12 Points: 1,035, Level: 12
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: , , USA.
Posts: 196
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to jmss66
Default Progress Bar

Hi Guys,

I wanted to add a progress bar in my project. I don't remember which component I needed to add. I was looking for anything that resembles progress bar or any Active X control but I can't seem to find it. Can someone please help me add a progress bar to my project.

Thanks,
Judy

Reply With Quote
  #2 (permalink)  
Old December 19th, 2005, 04:07 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Alameda, ca, USA.
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It's in mscomctl.ocx, that you can include using the Components dialog (Ctrl+T) selecting:

Microsoft Windows Common Control 6.0 (SP3)

or whatever service pack you have.

Marco

BTW I do not like that control at all. I prefer make my own using a simple PictureBox, because I can add much more flexibility.
Reply With Quote
  #3 (permalink)  
Old December 19th, 2005, 04:22 PM
Friend of Wrox
Points: 1,035, Level: 12
Points: 1,035, Level: 12 Points: 1,035, Level: 12 Points: 1,035, Level: 12
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: , , USA.
Posts: 196
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to jmss66
Default

Hi Macro,

Thanks. I was able to add it in. I am interested in what you said about creating your own using a picture box. Do you have any samples of code or any site that has this?

Thanks,
Judy

Reply With Quote
  #4 (permalink)  
Old December 19th, 2005, 07:12 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Alameda, ca, USA.
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I set the BackColor and ForeColor of the PictureBox to something like White and Blue. Then I use the Scale property to set the range of the progress bar (equivalent to the Max property of the scrollbar) like:

picture.scale (0,0)-(maxVal,1)

if the progress bar is horizontal, otherwise

picture.scale (0,0)-(1,maxVal)

And then in the picture Paint event:

Picture.Line (0, 0)-(pValue, 1), , BF

(horizontal) where pValue is the current progress value.

This is the concept. Playing with the paint event, it is possible to get other fancy effects. I wrapped all the code in a nice class, so that I can add more properties as needed.

Marco
Reply With Quote
  #5 (permalink)  
Old December 27th, 2005, 03:55 PM
Friend of Wrox
Points: 1,035, Level: 12
Points: 1,035, Level: 12 Points: 1,035, Level: 12 Points: 1,035, Level: 12
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: , , USA.
Posts: 196
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to jmss66
Default

Hi Macro,

I'll play with this code. Thanks again for your help.

Judy

Reply With Quote
  #6 (permalink)  
Old December 16th, 2009, 11:57 AM
Authorized User
 
Join Date: Dec 2003
Location: Vashi, Navi Mumbai, Maharashtra, India.
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
Post progress bar help

i have 15 table in 15 table i have to append some field in to one master table like below
table A
head of account(PK),date,dr,cr
table B
TID,details,name of subcriber,amount
table C
table D
etc....
in master table
i am append some record like head of account, name of subscriber, dr-cr=amount like all table
in all 15 table 1000 of records
now i wanted to add a progress bar when i am going click event in a form
Can someone please help me how to add a progress bar for click event in my form for appending
all records to main table
__________________
Mohamed Mohiddin
Officer
Reply With Quote
  #7 (permalink)  
Old December 16th, 2009, 09:25 PM
Friend of Wrox
Points: 3,060, Level: 23
Points: 3,060, Level: 23 Points: 3,060, Level: 23 Points: 3,060, Level: 23
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2005
Location: , , .
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts
Default

Hi

You can try something similar to the one below

Code:
ProgressBar1.Value = iTabCnt * iRecCnt / (iTotalTableCount * iTotalRecCnt)
Since you will be looping through each Table, iTabCnt will be the Table index (1 for first table etc)

Similarly iRecCnt wll be the record index

If you are sure about the total records and tables then you can have something like this

Code:
ProgressBar1.Value = iTabCnt * iRecCnt / (15 * 1000)


Cheers
Shasur
__________________
C# Code Snippets (http://www.dotnetdud.blogspot.com)

VBA Tips & Tricks (http://www.vbadud.blogspot.com)
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Progress Bar dotnetsathya VS.NET 2002/2003 0 September 26th, 2007 12:33 AM
Progress bar Poncho Pro VB 6 1 March 23rd, 2006 02:18 PM
progress bar treasacrowe Classic ASP Basics 11 February 11th, 2005 09:47 AM
Progress Bar BSkelding ASP.NET 1.0 and 1.1 Basics 3 May 4th, 2004 04:12 AM
Progress Bar Help jacob_d_99 Javascript How-To 1 November 20th, 2003 10:18 PM



All times are GMT -4. The time now is 07:20 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.