Wrox Programmer Forums
| 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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old December 19th, 2005, 03: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

  #2 (permalink)  
Old December 19th, 2005, 05: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.
  #3 (permalink)  
Old December 19th, 2005, 05: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

  #4 (permalink)  
Old December 19th, 2005, 08: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
  #5 (permalink)  
Old December 27th, 2005, 04: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

  #6 (permalink)  
Old December 16th, 2009, 12:57 PM
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
  #7 (permalink)  
Old December 16th, 2009, 10: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)


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 03:18 PM
progress bar treasacrowe Classic ASP Basics 11 February 11th, 2005 10: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 11:18 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.