|
-
Dec 6th, 2006, 01:41 AM
#1
Thread Starter
Fanatic Member
[RESOLVED] [2005] Using a basic progress bar accurately
Hello everyone,
Is there any standard formula that can help in making a progressbar move accurately according to any value?
Say if I have a value of 2315,what formula is generally used to make it equivalent to 100% and make the progressbar step according to the progress made to reach that value?
For example,imagine your program would send email to people on your address book,if the address book contains 2412 email addresses,how can it show the progress bar move accurately?
Can someone help me?
Thanks
Last edited by uniquegodwin; Dec 6th, 2006 at 01:43 AM.
Reason: changed my message a bit to make it understandable
Godwin
Help someone else with what someone helped you! 
-
Dec 6th, 2006, 01:43 AM
#2
Re: [2005] Using a basic progress bar accurately
Set the Max property of the progressbar to 1245. This will make a value of 622.5 or so exactly 50% of the progressbar, for example.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Dec 6th, 2006, 01:46 AM
#3
Thread Starter
Fanatic Member
Re: [2005] Using a basic progress bar accurately
Thanks Rob but,how can it show the exact progress from 1,2,3,4 and so on? i mean how does it work on other applications?
Last edited by uniquegodwin; Dec 6th, 2006 at 01:49 AM.
Godwin
Help someone else with what someone helped you! 
-
Dec 6th, 2006, 01:47 AM
#4
Thread Starter
Fanatic Member
Re: [2005] Using a basic progress bar accurately
For example,imagine your program would send email to people on your address book,if the address book contains 2412 email addresses,how can it show the progress bar move accurately as the email finishes sending to all the recipents depending on whatever the number?
Godwin
Help someone else with what someone helped you! 
-
Dec 6th, 2006, 01:48 AM
#5
Re: [2005] Using a basic progress bar accurately
What ever is your progress, looping for example, you would know the number of iterations and then divide the max by the number of iterations. Then increment in each loop by that number.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Dec 6th, 2006, 01:49 AM
#6
Re: [2005] Using a basic progress bar accurately
 Originally Posted by uniquegodwin
For example,imagine your program would send email to people on your address book,if the address book contains 2412 email addresses,how can it show the progress bar move accurately as the email finishes sending to all the recipents depending on whatever the number?
Yes, for each email just increase the Value of the progressbar by its current value plue one.
VB Code:
For i As Integer = 1 to 1245
'Send Email code
Me.Progressbar1.Value = Me.Progressbar.Value + 1
Next
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Dec 6th, 2006, 01:56 AM
#7
Thread Starter
Fanatic Member
Re: [2005] Using a basic progress bar accurately
Would it be possible for you to give an example? :s
VB Code:
For i= 1 to 1234
progressbar.value+=1?
Next i
Godwin
Help someone else with what someone helped you! 
-
Dec 6th, 2006, 01:58 AM
#8
Re: [2005] Using a basic progress bar accurately
For a more complete example...
VB Code:
Me.Progressbar1.Value = 0
Me.Progressbar1.Max = 1245
For i As Integer = 1 to 1245
'Send Email code
Me.Progressbar1.Value = Me.Progressbar.Value + 1
Next
There i not much more to it then that unless I am misunderstanding you?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Dec 6th, 2006, 01:59 AM
#9
Re: [2005] Using a basic progress bar accurately
If you have N things to do then you set the Maximum to N, the Step to 1 and call PerformStep each time you do something. If each operation doesn't have the same value then you can set the Value property explicitly but it's preferred to call PerformStep if each step is of equal value.
Now, there are various ways to calculate progress. If you have 10 things to do and one of them takes an hour while the others take 1 minute each then 10 equal steps doesn't really cut it. It really depends on what you're doing as to what is the best way to calculate the current progress.
-
Dec 6th, 2006, 02:03 AM
#10
Re: [2005] Using a basic progress bar accurately
Specifying Step is optional if the iteration is performed in increments of 1.
For this if the emails are all the same but with different verbiage then it should be close to accurate. But if there is any network connection issues or times of high network resource use then it will vary. Also, if there are differences in the emails like attachment count/size then it will vary even more.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Dec 6th, 2006, 02:12 AM
#11
Thread Starter
Fanatic Member
Re: [2005] Using a basic progress bar accurately
Thanksss Jm and Rob
Godwin
Help someone else with what someone helped you! 
-
Dec 6th, 2006, 02:15 AM
#12
Re: [RESOLVED] [2005] Using a basic progress bar accurately
Yes you're bad! (post #2) 
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Dec 6th, 2006, 02:16 AM
#13
Thread Starter
Fanatic Member
Re: [RESOLVED] [2005] Using a basic progress bar accurately
yeah...surely..
sorry i edited it,cos sounded embarassing
Godwin
Help someone else with what someone helped you! 
-
Dec 6th, 2006, 02:17 AM
#14
Re: [RESOLVED] [2005] Using a basic progress bar accurately
I'm willing to take credit for your advice Rob, so make sure it's good advice because I don't want to steal credit for any old rubbish.
-
Dec 6th, 2006, 02:19 AM
#15
Re: [RESOLVED] [2005] Using a basic progress bar accurately
So if its bad advice then you will take credit for that as its not old.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|