1
Reply

commission rate display wrong when write commission textbox1

ahmed elbarbary

ahmed elbarbary

Dec 20 2017 2:13 AM
102
my problem is cannot able to write any number in commission textbox (textbox1) and display result in textbox2 that represent commision rate .
 
commision rate = (commission/amount ) * 100
I have 3 text boxes
 
textbox1 : represent Commission
Commission=(amount * rate)/100
textbox2 : represent CommissionRate
CommissionRate=(Commission/amount)*100
 
txtLgAmount represent amount
  1. private void textBox1_TextChanged(object sender, EventArgs e)  
  2. {  
  3.   
  4.     if (!string.IsNullOrEmpty(textBox1.Text) && !string.IsNullOrEmpty(txtLgAmount.Text))  
  5.     {  
  6.   
  7.        textBox2.Text = ((Convert.ToDecimal(textBox1.Text) / Convert.ToDecimal(txtLgAmount.Text))*100).ToString();  
  8.   
  9.     }  
  10.     else  
  11.     {  
  12.         textBox2.Text = "";  
  13.     }  

image problem attached below
 
 

Upload Source Code  Select only zip and rar file.
Answers (1)