computing the numeric value of 2 textbox without triggering with a button? (Windows Application)
-
Hello.. Example: there are 2 textbox, where i'll type a numeric value this is the value in the first 2 textbox, textBox1=500 textBox2=1000 then in textBox3 the sum of the 2 values in the textbox should be automatically generated without triggering it with a button. Example, i just finish typing those numbers and when i'll press tab in my keyboard, texBox3 should display=1500 how will i code it? thanks.
-
Hello.. Example: there are 2 textbox, where i'll type a numeric value this is the value in the first 2 textbox, textBox1=500 textBox2=1000 then in textBox3 the sum of the 2 values in the textbox should be automatically generated without triggering it with a button. Example, i just finish typing those numbers and when i'll press tab in my keyboard, texBox3 should display=1500 how will i code it? thanks.
-
private void textBox2_Leave(object sender, System.EventArgs e) { textBox3 = Convert.ToString( Convert.ToInt64(textBox1.Text)+Convert.ToInt64( textBox2.Text)); }
rahul
The above function is not a correct one... It ll give an error "Cannot implicitly convert type 'string' to 'System.Windows.Forms.TextBox'". To correct that, assign the converted string to the textbox3's text. textBox3.Text = Convert.ToString( Convert.ToInt64(textBox1.Text)+Convert.ToInt64( textBox2.Text));
Thanks & Rgds, Sri..
-
The above function is not a correct one... It ll give an error "Cannot implicitly convert type 'string' to 'System.Windows.Forms.TextBox'". To correct that, assign the converted string to the textbox3's text. textBox3.Text = Convert.ToString( Convert.ToInt64(textBox1.Text)+Convert.ToInt64( textBox2.Text));
Thanks & Rgds, Sri..