Israel

Israel

  • 701
  • 1.3k
  • 217.3k

Need using textbox value ONLY not specific number in codes

Mar 20 2019 3:54 PM
Hi,
 
These little code work fine. But I need that the message appear only when a number superior is inserted into textbox. Not number inside of codes. 
 
Int32 number = 0; Boolean success = false;
success = Int32.TryParse(txtCredit.Text, out number);
if (!success)
MessageBox.Show("Please enter a valid integer value!");
else
if (number >= 5) // Here is works but ONLY with number
// I'm trying to do this but its doenst work
if (number >= txtCredit.Text) // But here doesnt work. Its underlined in red.
MessageBox.Show("Atenção: Sua despesa é superior ao SALDO atualizado!");
 
Thanks,
Israel. 
 

Answers (2)