|
-
April 26th, 2001, 06:54 PM
#1
Progress Bar
Is it possable to put a progress bar in the status bar?
-
April 27th, 2001, 02:56 AM
#2
Re: Progress Bar
I think You can. using the API SetParent. i have seen an example of progressbar in toolbar.
Sharath
-
April 27th, 2001, 03:38 AM
#3
Re: Progress Bar
There is an example in
http://www.mvps.org/vb/
by Karl E. Peterson
cheers
Sharath
-
April 27th, 2001, 07:07 AM
#4
Re: Progress Bar
'NOTE: Project Needs to reference
' Microsoft Windows Common Controls
' Microsoft Windows Common Controls 2
'on the form Progr Bar, Timer, Status Bar (sbMain - 3 panels (go to prperties) )
Private Sub Form_Paint()
Dim BdrWth As Single
ScaleMode = vbTwips
'Determine Border Width - May need to be adjusted if a different border style is used
BdrWth = (Width - ScaleWidth) / 4
'Position status bar - "Output" is the Panel Key we want to draw on top of
pbProgress.Move sbMain.Panels("Output").Left, sbMain.Top + BdrWth, sbMain.Panels("Output").Width, sbMain.Height - BdrWth
End Sub
Private Sub Timer1_Timer()
'Increment Progress Value. - Reset at max
pbProgress.Value = IIf(pbProgress.Value = pbProgress.Max, pbProgress.Min, pbProgress.Value + 1)
'Set Default Timer Interval
Timer1.Interval = 1
'Update Display based on progress position
Select Case pbProgress.Value
Case pbProgress.Min:
'Just Begining
sbMain.Panels("Message").Text = "Start"
Timer1.Interval = 1000 'Longer delay
pbProgress.Visible = Not pbProgress.Visible 'Toggle Graphic/Text version each cycle
Case pbProgress.Max:
'Finishing
sbMain.Panels("Message").Text = "Done"
Timer1.Interval = 1000 'Longer delay
Case Else:
'Somewhere in the middle - Calculate Range
sbMain.Panels("Message").Text = CInt(100 * (pbProgress.Value - pbProgress.Min) / (pbProgress.Max - pbProgress.Min)) & "% Complete"
End Select
'Update Text on Panel - Wont see it unless status bar is not visible
sbMain.Panels("Output").Text = "Now showing text instead : " & sbMain.Panels("Message").Text
End Sub
Iouri Boutchkine
[email protected]
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
|