Solved

Calculate text from two text boxes into another text box

Posted on 2006-07-22
1
229 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
listing all functions in JavaScript 19 201
Not needed 13 112
C# Error - Add Failed 12 87
Auto-indent certain lines in Notepad++ 10 75
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This is about my first experience with programming Arduino.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

773 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