943,549 Members | Top Members by Rank

Ad:
Aug 17th, 2007
0

Can adding and subtracting be done

Expand Post »
Alright, I dont know if this can be done or not, but can you say, take either a caption or the text in a text box and add or subtract from what's in it, with a click of a button? Allow me to explain, lets say I have a text box with "100" as the text in it. Can I, with a click of a button, make it subtract from that 100?
Similar Threads
Reputation Points: 2
Solved Threads: 0
Newbie Poster
venomocity is offline Offline
16 posts
since Aug 2007
Aug 18th, 2007
0

Re: Can adding and subtracting be done

Hi.
That is simple

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Private Sub Form_Load()
  2. Me.Label1.Caption = 100
  3. End Sub
  4.  
  5. Private Sub Command1_Click()
  6. If IsNumeric(Me.Label1.Caption) Then Me.Label1.Caption = Me.Label1.Caption - 20
  7. End Sub

I hope that is what you were looking for.
Reputation Points: 13
Solved Threads: 29
Junior Poster
kb.net is offline Offline
169 posts
since Aug 2007

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Mail, minimise and browser question.
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: problem with opening form





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC