james james

james james

  • NA
  • 419
  • 29.8k

c# winform Math question

Jul 25 2018 3:47 PM
ii have 3 text boxes I have data in 2 of them, I need the third box to look at the first 2 and if textbox1 is less than textbox 2 than textbox 3 will equal whats in textbox2. If textbox1 is greater than textbox2 it will equal textbox1.
 
This is what I have tried as you notice the third line is Equal how can I use < less than?
 
  1. private void txtMinLogic_TextChanged(object sender, EventArgs e)
    {

  2. string a = txtHalfDayUsage.Text;  
  3. string b = tbGreaterThan.Text;  
  4.             if (a.Equals(b))  
  5.             {  
  6.                 txtMinLogic.Text = "";  
  7.             }  
  8.             else  
  9.             {  
  10.                 txtMinLogic.Text = txtHalfDayUsage.Text;  
  11.   
  12.             }  
  13. }  
 

Answers (2)