6 Replies - 20347 Views - Last Post: 04 November 2008 - 10:02 AM Rate Topic: -----

#1 markjnj  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 122
  • Joined: 27-October 08

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.

label.Text = String.Empty

Is This A Good Question/Topic? 0
  • +

Replies To: How to Clear Label Entry and reset count back to 0.

#2 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1641
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

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 :)
Was This Post Helpful? 1

#3 markjnj  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 122
  • Joined: 27-October 08

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.

View PostPsychoCoder, on 4 Nov, 2008 - 08:16 AM, said:

label.Text = "0"



Hope that helps :)

Was This Post Helpful? 0
  • +
  • -

#4 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1641
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

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)
Was This Post Helpful? 0
  • +
  • -

#5 markjnj  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 122
  • Joined: 27-October 08

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

Was This Post Helpful? 0
  • +
  • -

#6 magicmonkey  Icon User is offline

  • D.I.C Regular

Reputation: 106
  • View blog
  • Posts: 484
  • Joined: 12-September 08

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  


Was This Post Helpful? 1
  • +
  • -

#7 markjnj  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 122
  • Joined: 27-October 08

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?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1