|
-
Aug 26th, 2006, 02:45 AM
#1
Progress bar for the shelled process
Dear All
I thank you for everyone who helped for the this post.
And now my aim that how to display a progress bar for the shelled process.For example i am shelling viewer.exe with the file of 1.htm. How can I.
-
Aug 26th, 2006, 03:36 AM
#2
Re: Progress bar for the shelled process
Doing a real progress bar would require the shelled program to somehow be able to return it's progress to your program; in this case what you're requesting is impossible (or for the least very hard to do without further knowledge of internals of the shelled program). However, you could do a progress bar that doesn't really show anything else than that a progress is going on. I guess you've sometime seen a progress bar that has about 100 pixels wide "bar" that loops from left to right, bar coming in from the left and going out of the right, until everything is done?
Edit!
A poor man's sample: add Picture1, Label1 into Picture1 and a Timer1 to a new project. Paste this code:
VB Code:
Option Explicit
Private Sub Form_Load()
Picture1.ScaleMode = vbPixels
Picture1.BackColor = vbHighlightText
Label1.BackColor = vbHighlight
Label1.Caption = vbNullString
Label1.Move -100, 0, 100, Picture1.ScaleHeight
Timer1.Interval = 1
End Sub
Private Sub Timer1_Timer()
If Label1.Left <= Picture1.ScaleWidth Then
Label1.Left = Label1.Left + 5
Else
Label1.Left = -100
End If
End Sub
Last edited by Merri; Aug 26th, 2006 at 03:41 AM.
-
Aug 27th, 2006, 11:26 PM
#3
Re: Progress bar for the shelled process
Dear Merri,
Thanks for your post.This exe will open the html file in ie or some browser.Is it posible to get the estimated time and display a progress bar.
-
Aug 28th, 2006, 08:16 AM
#4
Re: Progress bar for the shelled process
The only way to estimate the time with any accuracy is to run it once and time it, then use that time for your progressbar when you open it again... obviously not a great solution as it will take twice as long (and will have other issues, like the app being open twice).
The only decent way to do it is not have a progressbar, but some kind of "working" message/graphic as Merri suggested.
Progress bars are only valid when you have a known time, or a known number of steps.
-
Aug 28th, 2006, 08:37 AM
#5
Re: Progress bar for the shelled process
Dear si,
The File size will vary from time to time.For this kind of situation it will be a tedious one.
-
Aug 28th, 2006, 08:48 AM
#6
Re: Progress bar for the shelled process
For html files, the size of the file is not the biggest factor in how long it will take to load - the complexity is (eg: the table layout/formatting/...), which is hard to determine (and will take time).
So, once again, a 'percent complete' or time-based progressbar is not valid.
Something like Merri posted is by far the best option.
-
Aug 28th, 2006, 11:55 AM
#7
Re: Progress bar for the shelled process
Try this - it'll show that something's happening.
VB Code:
Private Sub Timer1_Timer()
Static i As Integer
Select Case i
Case 0
lblTimer.Caption = "/"
i = 1
Case 1
lblTimer.Caption = "-"
i = 2
Case 2
lblTimer.Caption = "\"
i = 3
Case 3
lblTimer.Caption = "|"
i = 4
Case 4
lblTimer.Caption = "/"
i = 5
Case 5
lblTimer.Caption = "-"
i = 6
Case 6
lblTimer.Caption = "\"
i = 7
Case 7
lblTimer.Caption = "|"
i = 0
End Select
End Sub
lblTimer is a label that's about 1 character wide and 1 character high, with Alignment set to 2 - Center. The timer should be set for an interval of about 100.
The most difficult part of developing a program is understanding the problem.
The second most difficult part is deciding how you're going to solve the problem.
Actually writing the program (translating your solution into some computer language) is the easiest part.
Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.
Please Help Us To Save Ana
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
|