VB6 Help- Text box not working
hey im new here and I was wodering if you guys can help me... this is what I have
Im trying to make a progressbar start when I press the start buttonand when the progressbar reaches 100 on the textbox it adds
"Its Done!"
on my commandbox I have
timer1.enabled = True
And my timer1 is enabled.
in my timer1 I have
progressbar1.Value = val (Progressbar1.value) + val(5)
or sumething like that. But it works fine.
What I need now is that when the progressbar reaches 100 this will add to the textbox:
"Its Done!"
plus what ever is written on it. But if i write this
if progressbar1.value = 100 then
text1.text = text1.text & "Its Done!"
end if
but it will keep adding "Its Done!" and it will never finish. How can I make it type only one time? Thnx
Re: VB6 Help- Text box not working
Welcome to the Forums :wave:
You need to stop your timer.
Just add
Code:
Timer1.enabled = False
inside that if statement.
Happy Coding
~Jawa
Re: VB6 Help- Text box not working
Quote:
Originally Posted by
javajawa
Welcome to the Forums :wave:
You need to stop your timer.
Just add
Code:
Timer1.enabled = False
inside that if statement.
Happy Coding
~Jawa
I tried that and it didnt work. ill be posting my file.
Re: VB6 Help- Text box not working
Code:
Private Declare Function GetVolumeInformation Lib "Kernel32" Alias "GetVolumeInformationA" (ByVal lpRootPathName As String, ByVal lpVolumeNameBuffer As String, ByVal nVolumeNameSize As Long, lpVolumeSerialNumber As Long, lpMaximumComponentLength As Long, lpFileSystemFlags As Long, ByVal lpFileSystemNameBuffer As String, ByVal nFileSystemNameSize As Long) As Long
Private Sub alertpay_Click()
Dim strLink As String
strLink = "http://www.alertpay.com"
Shell "c:\program files\internet explorer\iexplore " & strLink
End Sub
Private Sub Command1_Click()
Timer1.Enabled = True
If Command1.Enabled = True Then
Command1.Caption = "Sending info..."
End If
Command1.Enabled = False
Text1.Text = Text1.Text & " Sending your HWID to our sever. This is will take less than 1 min."
End Sub
Private Sub exit_Click()
Unload Me
End Sub
Private Sub form_load()
Dim Serial As Long, VName As String, FSName As String
'Create buffers
VName = String$(255, Chr$(0))
FSName = String$(255, Chr$(0))
'Get the volume information
GetVolumeInformation "C:\", VName, 255, Serial, 0, 0, FSName, 255
'Strip the extra chr$(0)'s
VName = Left$(VName, InStr(1, VName, Chr$(0)) - 1)
FSName = Left$(FSName, InStr(1, FSName, Chr$(0)) - 1)
Text1.Text = "Your computer HWID is:" + Trim(Str$(Serial)) + " "
End Sub
Private Sub google_Click()
Dim strLink As String
strLink = "https://www.google.com/accounts/ServiceLogin?service=sierra&continue=https%3A%2F%2Fcheckout.google.com%2F%3Fupgrade%3Dtrue&hl=en&nui=1<mpl=default"
Shell "c:\program files\internet explorer\iexplore " & strLink
End Sub
Private Sub help_Click()
Dim strLink As String
strLink = "http://www.n-vision.org"
Shell "c:\program files\internet explorer\iexplore " & strLink
End Sub
Private Sub HWID_Click()
Dim strLink As String
strLink = "http://www.n-vision.org/forum/showthread.php?t=5"
Shell "c:\program files\internet explorer\iexplore " & strLink
End Sub
Private Sub info_Click()
Form2.Show
End Sub
Private Sub paypal_Click()
Dim strLink As String
strLink = "http://www.paypal.com"
Shell "c:\program files\internet explorer\iexplore " & strLink
End Sub
Private Sub Timer1_Timer()
If ProgressBar1.Value = 100 Then
ProgressBar1.Value = 100
Else
ProgressBar1.Value = Val(ProgressBar1.Value) + Val(10)
End If
Label4.Caption = ProgressBar1.Value
If ProgressBar1.Value = 10 Then
Command1.Caption = "Downloading..."
End If
If ProgressBar1.Value = 100 Then
Command1.Caption = "Done."
End If
End Sub
The only way to make the "Done!" to work is that if I put the code I said in the timer but it keeps looping :
"Done!"
"Done!"
"Done!"
"Done!"
"Done!"
"Done!"
Re: VB6 Help- Text box not working
What's the interval of the Timer? <15 doesn't even fire. 1000 is one second (I'd use 500 or 1/2 second)
Re: VB6 Help- Text box not working
Quote:
Originally Posted by
dglienna
What's the interval of the Timer? <15 doesn't even fire. 1000 is one second (I'd use 500 or 1/2 second)
is 1000
1 Attachment(s)
Re: VB6 Help- Text box not working
here is the file. once you click update it will say is downloading but dont worry. I took out that option.
Re: VB6 Help- Text box not working
Code:
....
Private Sub Command1_Click()
Timer1.Enabled = True
If Command1.Enabled = True Then
Command1.Caption = "Sending info..."
End If
Command1.Enabled = False
Text1.Text = Text1.Text & " Sending your HWID to our sever. This is will take less than 1 min."
End Sub
Private Sub exit_Click()
Unload Me
End Sub
...
Private Sub Timer1_Timer()
If ProgressBar1.Value >= 100 Then
ProgressBar1.Value = 100
Timer1.Enabled= false
Command1.Caption = "Done."
Else
ProgressBar1.Value = Val(ProgressBar1.Value) + Val(10)
End If
Label4.Caption = ProgressBar1.Value
If ProgressBar1.Value = 10 Then
Command1.Caption = "Downloading..."
End If
End Sub
Do it this way:wave: