|
-
Nov 12th, 2007, 05:25 AM
#1
Thread Starter
New Member
Need help with boolean
Here is a snippet
If total.Value = 1073741824 Then tb.Text = "test"
What i want this to do,is when TOTAL reaches 1073741824 it will change the text in the text box,Why isnt this working? it will run no problem it just wont change the text box.
Also,how can i make the program automatically plus 1 to the existing number in the text box when the Amount is reached?
Last edited by neodude112320; Nov 12th, 2007 at 05:56 AM.
-
Nov 12th, 2007, 06:53 AM
#2
Re: Need help with boolean
That code does what it does, but if it's not executed in a useful place then what it does is useless. Where is it executed? We need context.
-
Nov 12th, 2007, 04:17 PM
#3
Frenzied Member
Re: Need help with boolean
As jmcilhinney said, we need a little more info.
You can add a messagebox into your code. That will pop up and tell you WHEN the value has been calculated to that amount.
Code:
If total.Value = 1073741824 Then
tb.Text = "test"
MsgBox("test")
End If
If you don't see the message box, then it never reaches that number.
.
~Peter

-
Nov 12th, 2007, 04:34 PM
#4
Re: Need help with boolean
 Originally Posted by MrGTI
As jmcilhinney said, we need a little more info.
You can add a messagebox into your code. That will pop up and tell you WHEN the value has been calculated to that amount.
Code:
If total.Value = 1073741824 Then
tb.Text = "test"
MsgBox("test")
End If
If you don't see the message box, then it never reaches that number.
.
That method was used before there were proper debug tools. Visual Studio provides excellent debugging, use a breakpoint instead
-
Nov 12th, 2007, 05:43 PM
#5
Thread Starter
New Member
Re: Need help with boolean
Ok,Here is exactly where it is:
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
total.Value = bytes.RawValue
TextBox1.Text = bytes.RawValue
If total.Value = 1073741824 Then
tb.Text = "test"
End If
End Sub
End Class
And it still wont change the text in tb.
-
Nov 12th, 2007, 05:48 PM
#6
Re: Need help with boolean
Are you sure the Timer is Enabled? If it is then presumably total.Value never actually equals that value.
-
Nov 12th, 2007, 06:13 PM
#7
Re: Need help with boolean
What datatype is total.value?
-
Nov 12th, 2007, 07:17 PM
#8
Thread Starter
New Member
Re: Need help with boolean
The Timer is enabled and working,Total is the name for my progress bar,Value gets or sets the progress of the bar.
-
Nov 12th, 2007, 07:54 PM
#9
Addicted Member
Re: Need help with boolean
Could your number accumulator (total) be incementing faster than your timer polls for its value?
Somehow you should tie an event to the changing of total and check the value there.
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
|