Can adding and subtracting be done

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Aug 2007
Posts: 15
Reputation: venomocity is an unknown quantity at this point 
Solved Threads: 0
venomocity's Avatar
venomocity venomocity is offline Offline
Newbie Poster

Can adding and subtracting be done

 
0
  #1
Aug 17th, 2007
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?
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 160
Reputation: kb.net is an unknown quantity at this point 
Solved Threads: 26
kb.net's Avatar
kb.net kb.net is offline Offline
Junior Poster

Re: Can adding and subtracting be done

 
0
  #2
Aug 18th, 2007
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.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC