I have seen a lot of games in start loading the StatusBar &
progressbar showing that msg (now loading) and the
ProgressBar runing
could some help with a simple example
thank you in advance
Printable View
I have seen a lot of games in start loading the StatusBar &
progressbar showing that msg (now loading) and the
ProgressBar runing
could some help with a simple example
thank you in advance
I can give you a example but what are you loading what has to be shown in the progressbar
VB Code:
Private Sub Command1_Click() StatusBar.Panels(1).Text = "Now loading" ProgressBar.Value = Progress End Sub
If you provide what you're loading I can give you a more specific example!
Grtz,
Bloged
I think he means like in IE how it shows the progressbar INSIDE of the status bar... it's a really neat effect, but I don't know how to do it. Look around on http://www.vbweb.co.uk/, it has some good stuff.
Oh that effect!
Sorry misunderstood you!!
I saw that ones... They didn't use the statusbar but labels... and one progressbar... So it looked like a statusbar....
Hope you understand what I mean...
Grtz,
Bloged
Hey I made a nice progress bar control a while ago, it supports images, ***automatic color gradations***, and doesn't flicker like most progress bars! ;)
You can download it here:
http://forums.vb-world.net/showthrea...threadid=79856
>>>>>>>i have found example in vb but i gut confuse when i try to change (Dim iCounter As Integer)as (form1.show...value)
Option Explicit
Private Sub cmdType_Click(Index As Integer)
Dim MyCollection As New Collection
Dim iCounter As Integer
Dim dStart As Double, dFinish As Double
Dim sAnswer As String
Dim pnlStatus As Panel
Dim vItem As Variant
Set pnlStatus = frmCollection.StatusBar.Panels(1)
Screen.MousePointer = vbHourglass
dStart = Timer
Select Case Index
Case 1 ' For Each
pnlStatus.Text = "Building Collection..."
StatusBar.Refresh
ProgBar.Max = Val(txtLoopCount(2).Text)
For iCounter = 1 To Val(txtLoopCount(2).Text)
If iCounter Mod 10 = 0 Then ProgBar.Value = iCounter
MyCollection.Add Item:=CStr(iCounter), Key:=CStr(iCounter)
Next iCounter
pnlStatus.Text = "Retrieving Items..."
StatusBar.Refresh
dStart = Timer
For Each vItem In MyCollection
sAnswer = MyCollection(vItem)
Next vItem
Case 2 ' For Next
pnlStatus.Text = "Building Collection..."
StatusBar.Refresh
ProgBar.Max = Val(txtLoopCount(2).Text)
For iCounter = 1 To Val(txtLoopCount(2).Text)
If iCounter Mod 10 = 0 Then ProgBar.Value = iCounter
MyCollection.Add Item:=CStr(iCounter), Key:=CStr(iCounter)
Next iCounter
pnlStatus.Text = "Iterating the Collection..."
StatusBar.Refresh
dStart = Timer
For iCounter = 1 To MyCollection.Count
sAnswer = MyCollection(iCounter)
Next iCounter
End Select
dFinish = Timer
Set MyCollection = Nothing
lblResult(Index).Caption = Format$(dFinish - dStart, "00.00") & " secs."
pnlStatus.Text = ""
ProgBar.Value = 0
Screen.MousePointer = vbDefault
End Sub
but instead of runing the (Val(txtLoopCount(2).Text) i would to change it with form1.show (the progbar.value should be the same as the time of form1 .show)
Hum, it would be easier if you put the project here so I can have a look at it and fix it...
my project is very simple
i have create db in access as (db1)
link with form2
i have create form as mainform with
progressbar
statusbar
one click button
Private Sub Command1_Click()
Option Explicit
Private Sub cmdType_Click(Index As Integer)
Dim MyCollection As New Collection
Dim iCounter As Integer
Dim dStart As Double, dFinish As Double
Dim sAnswer As String
Dim pnlStatus As Panel
Dim vItem As Variant
Set pnlStatus = frmCollection.StatusBar.Panels(1)
Screen.MousePointer = vbHourglass
dStart = Timer
Select Case Index
Case 1 ' For Each
pnlStatus.Text = "Building Collection..."
StatusBar.Refresh
ProgBar.Max = Val(txtLoopCount(2).Text)
For iCounter = 1 To Val(txtLoopCount(2).Text)
If iCounter Mod 10 = 0 Then ProgBar.Value = iCounter
MyCollection.Add Item:=CStr(iCounter), Key:=CStr(iCounter)
Next iCounter
pnlStatus.Text = "Retrieving Items..."
StatusBar.Refresh
dStart = Timer
For Each vItem In MyCollection
sAnswer = MyCollection(vItem)
Next vItem
Case 2 ' For Next
pnlStatus.Text = "Building Collection..."
StatusBar.Refresh
ProgBar.Max = Val(txtLoopCount(2).Text)
For iCounter = 1 To Val(txtLoopCount(2).Text)
If iCounter Mod 10 = 0 Then ProgBar.Value = iCounter
MyCollection.Add Item:=CStr(iCounter), Key:=CStr(iCounter)
Next iCounter
pnlStatus.Text = "Iterating the Collection..."
StatusBar.Refresh
dStart = Timer
For iCounter = 1 To MyCollection.Count
sAnswer = MyCollection(iCounter)
Next iCounter
End Select
dFinish = Timer
Set MyCollection = Nothing
lblResult(Index).Caption = Format$(dFinish - dStart, "00.00") & " secs."
pnlStatus.Text = ""
ProgBar.Value = 0
Screen.MousePointer = vbDefault
form2.show
End Sub
'my request
when i click on button
then
form2.will show but i want to make a link between the progressbar and form2
if you run the top example you will see that the progresbar is run
when it finish then form2 will show after maybe 10 second
form2 should be visible when the prog.bar value is completed
the top example i have found in vb/sample/optimize
trying to use it in my project that's all
i hope it's not confused
thank you
Sorry but right now VB isn't working, so I can't check your code :(
You'll have to wait until tomorrow, it's getting late :D
I have got replay to wait until tomorrow
since 9-8-2001
is there anyone to help please
Hey, that form is the "Code Optimizations" form that comes with the VB samples :rolleyes:
(Sorry but I forgot to mention that I wasn't gonna be at home the day after I replied :p )