Solved

Calculate text from two text boxes into another text box

Posted on 2006-07-22
1
227 Views
Last Modified: 2010-04-17
I have two text boxes that  txtbox1 require the operator to enter a value, this value is the initial RAW weight then Txt BOX2 is the final weight after some gain, on TXTbox3 I want to give me a calculated percent value as the values are input on the TXTBOX1 and TXTBOX2 , but I need to get this gain value without any CLICK bottoms, as soon as the operator input the value on TXTBOX1 or TXTBOX2   I want to see percent values on TXTBOX3
0
Comment
Question by:teogos
1 Comment
 
LVL 18

Accepted Solution

by:
Ravi Singh earned 250 total points
ID: 17160577
Which programming language are you using? After looking at your recently asked question I'll assume your using visual basic for now...

You can handle the Change event for textbox1, textbox2... in the event handling procedure you can update textbox3 with the calculation result depending on whats already in textbox1 and 2... small example to give you an idea:

Private Sub txtBox1_Change()
    If Trim(Me.txtBox1.Text) <> "" And IsNumeric(Me.txtBox1.Text) Then        
         If Trim(Me.txtBox2.Text) <> "" And IsNumeric(Me.txtBox2.Text) Then
            Me.txtBox3.Text = <Your calculation here>
        End If
    End If
End Sub

Private Sub txtBox2_Change()
    If Trim(Me.txtBox2.Text) <> "" And IsNumeric(Me.txtBox2.Text) Then        
         If Trim(Me.txtBox1.Text) <> "" And IsNumeric(Me.txtBox1.Text) Then
            Me.txtBox3.Text = <Your calculation here>
        End If
    End If
End Sub

This should change the value of txtBox3 as and when the values are typed into txtBox1 & 2
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
delphi parse string to params 3 82
advertisement module in core php 4 89
Currency Conversion? 1 37
Birthdays 3 14
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now