|
-
Oct 28th, 2000, 01:01 AM
#1
Thread Starter
New Member
Hi i am in need of a code so that i can have text changing similar to in installers and in dos when u r formating
eg. like 1% then go to 10% but on the same line overwriting each other, like when u r installing and it shows your progress!!
i want to make a fake format and need this code to complete it
thank you
ryanchu
-
Oct 28th, 2000, 01:15 AM
#2
Member
They just update the caption of a label. Try this out.
On a form put a timer and a label. Paste the folowing code
VB Code:
Option Explicit
Dim x As Integer
Private Sub Form_Load()
Label1 = ""
Timer1.Interval = 100
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
x = x + 1
If x = 100 Then
Timer1.Enabled = False
Label1 = "Format Complete"
Exit Sub
End If
Label1 = x & " % Formated"
End Sub
-
Oct 28th, 2000, 01:37 AM
#3
You don't need a timer. Just use the For...Next Statement.
Code:
Private Sub Command1_Click()
For i = 0 To 100
DoEvents
Label1.caption = i
If i = 100 Then
MsgBox "done"
End If
Next i
Label1.caption = i & "% formatted!"
End Sub
-
Oct 28th, 2000, 01:45 AM
#4
Thread Starter
New Member
????
Sorry im a beginner so i dont understand!!!
here is what i have so far, can u please fix it up as i dont know what u r talkin about
Private Sub cmdStart_Click()
Let aname = InputBox$("Please Enter Your Name")
delay5
frmMain.Print "Okay "; (aname); " We Are Gonna Play A Little Game!!"
delay2
x = MsgBox("Do You Want To Play??", vbYesNo)
delay3
If x = vbYes Then MsgBox "Good, Im Glad You Want To Play!!"
If x = vbNo Then MsgBox "Too Bad, We Are Gonna Play Anyway!!"
delay3
MsgBox "Okay Let's Begin Then"
delay3
MsgBox "First of all lets perform a test to see how much free space you have left on your hardrive"
delay3
frmMain.Print "Testing.........."
delay
frmMain.Print "Testing Complete"
delay2
frmMain.Print "Reading Results...."
delay2
c = MsgBox("Oh Dear!!! It seems that your hard drive is a bit full!!, I know i'll give it a clean for you!!, Is That Okay??", vbYesNo)
delay3
If c = vbYes Then MsgBox "Good, This should clear up your hard drive a bit"
If c = vbNo Then MsgBox "Too Bad!!!!!, I'm gonna do it anyway"
delay2
frmMain.Print "C:\Format C:"
delay2
frmMain.Print "WARNING, ALL DATA THIS DRIVE (C WILL BE LOST"
frmMain.Print "Proceed with Format (Y/N)?"
delay4
frmMain.Print "Yes"
delay2
frmMain.Print "Format Commencing......."
THIS IS WERE IT MUST HAVE IT COUNTING
End Sub
Private Sub delay()
For Number = 1 To 7000000
Next
End Sub
Private Sub delay2()
For Number = 1 To 3000000
Next
End Sub
Private Sub delay3()
For Number = 1 To 1500000
Next
End Sub
Private Sub delay4()
For Number = 1 To 5000000
Next
End Sub
Private Sub delay5()
For Number = 1 To 2000000
Next
End Sub
thanx for your help
-
Oct 28th, 2000, 07:30 AM
#5
Frenzied Member
Ok here we go, put a progressbar on your form (you can find them in the Microsoft Common Controls)
Code:
Private Sub cmdStart_Click()
Let aname = InputBox$("Please Enter Your Name")
delay5
frmMain.Print "Okay "; (aname); " We Are Gonna Play A Little Game!!"
delay2
x = MsgBox("Do You Want To Play??", vbYesNo)
delay3
If x = vbYes Then MsgBox "Good, Im Glad You Want To Play!!"
If x = vbNo Then MsgBox "Too Bad, We Are Gonna Play Anyway!!"
delay3
MsgBox "Okay Let's Begin Then"
delay3
MsgBox "First of all lets perform a test to see how much free space you have left on your hardrive"
delay3
frmMain.Print "Testing.........."
delay
frmMain.Print "Testing Complete"
delay2
frmMain.Print "Reading Results...."
delay2
c = MsgBox("Oh Dear!!! It seems that your hard drive is a bit full!!, I know i'll give it a clean for you!!, Is That Okay??", vbYesNo)
delay3
If c = vbYes Then MsgBox "Good, This should clear up your hard drive a bit"
If c = vbNo Then MsgBox "Too Bad!!!!!, I'm gonna do it anyway"
delay2
frmMain.Print "C:\Format C:"
delay2
frmMain.Print "WARNING, ALL DATA THIS DRIVE (C WILL BE LOST"
frmMain.Print "Proceed with Format (Y/N)?"
delay4
frmMain.Print "Yes"
delay2
frmMain.Print "Format Commencing......."
'THIS IS WERE IT MUST HAVE IT COUNTING
'THIS IS THE COUNTING!
Progressbar1.Max = 10000000
For Number = 1 to 10000000 'any number you want but formatting takes long.
Progressbar1.Value = Number
DoEvents 'Really Important!
Next Number
'END OF THE COUNTING!
End Sub
Private Sub delay()
For Number = 1 To 7000000
Next
End Sub
Private Sub delay2()
For Number = 1 To 3000000
Next
End Sub
Private Sub delay3()
For Number = 1 To 1500000
Next
End Sub
Private Sub delay4()
For Number = 1 To 5000000
Next
End Sub
Private Sub delay5()
For Number = 1 To 2000000
Next
End Sub
[Edited by Jop on 10-28-2000 at 09:14 AM]
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
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
|