|
-
Feb 16th, 2005, 09:03 AM
#1
Thread Starter
Member
How to do appending in calculation code
for example. if I had in a program a 1,2,3 button and a plus operator button and two display txt boxes. I want to retain what I a madding in the one text box box. for example if I have 1+2+2 = 5, how ever I want keep this information display in thte one text box, and if I was to ad a - button and use it with the about number example 1+2+2 =5 -1-2 = 3 (ignor the = just for show) I know you have to append the code but not sure how to
txtOutPut.text = ? retaining information in Output text box. Below are code for the + and 7 buttons so you can see what I hav done.
PrivateSub btn7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn7.Click
If clearDisplay Then
txtInput.ResetText()
clearDisplay = False
EndIf
txtInput.Text = txtInput.Text + sender.Text
If txtInput.Text = TrueThen
txtOutput.Text = txtInput.Text
EndIf
PrivateSub btnPlus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPlus.Click
operand1 = Val(txtOutput.Text)
operator = "+"
clearDisplay = True
If txtInput.Text = TrueThen
txtOutput.Text = txtOutput.Text & "+"
EndIf
I hope this maks sense?
In Short I want to keep the calculation I am doing in one text box that is visiable as you are preforming calculatings, until you hit the clear button
Regards
Marcus
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
|