label.Text = String.Empty
6 Replies - 48578 Views - Last Post: 04 November 2008 - 10:02 AM
#1
How to Clear Label Entry and reset count back to 0.
Posted 04 November 2008 - 09:05 AM
I have a label that is keeping a running total. I have a clear button that I want to be able to clear out that label as well as reset the the running total back to 0. right now I have it set to clear the label but it doesn't reset the running total back to 0.
Replies To: How to Clear Label Entry and reset count back to 0.
#2
Re: How to Clear Label Entry and reset count back to 0.
Posted 04 November 2008 - 09:16 AM
label.Text = "0"
Hope that helps

#3
Re: How to Clear Label Entry and reset count back to 0.
Posted 04 November 2008 - 09:32 AM
when I go to put in a new number to start a new running total it is still continuing from where I left off. say I left off at 7, then I hit the clear button. When I go to put a 3 in my label shows 10, b/c it still has the 7 in memory I guess.
Hope that helps
PsychoCoder, on 4 Nov, 2008 - 08:16 AM, said:
label.Text = "0"
Hope that helps

#4
Re: How to Clear Label Entry and reset count back to 0.
Posted 04 November 2008 - 09:34 AM
Show us the code that you're using (not just the code that clears the label)
#5
Re: How to Clear Label Entry and reset count back to 0.
Posted 04 November 2008 - 09:37 AM
Here's the code. Thanks...
This post has been edited by markjnj: 04 November 2008 - 10:02 AM
#6
Re: How to Clear Label Entry and reset count back to 0.
Posted 04 November 2008 - 09:54 AM
Reset all your counter variables as well?
Private Sub btnClear_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnClear.Click 'clear all entries lblFullTimeNewCarsSold.Text = String.Empty lblFullTimeUsedCarsSold.Text = String.Empty lblPartTimeNewCarsSold.Text = String.Empty lblPartTimeUsedCarsSold.Text = String.Empty TextBox1.Text = String.Empty totalfn = 0 totalfu = 0 totalpn = 0 totalpu = 0 End Sub
#7
Re: How to Clear Label Entry and reset count back to 0.
Posted 04 November 2008 - 10:02 AM
cool. that was it. thanks!
[quote name='magicmonkey' date='4 Nov, 2008 - 08:54 AM' post='455676']
Reset all your counter variables as well?
[quote name='magicmonkey' date='4 Nov, 2008 - 08:54 AM' post='455676']
Reset all your counter variables as well?
Page 1 of 1