A little C# help???

by 3 replies
4
I think this is simple, but I didn't get a good answer though I googled it few times. This is what,

I have a Windows Form Application(Visual Studio 2010) with these text boxes: subTotal, advance, balance.

And this is what I want to do, just after a user inserts values to the subTotal and advance text boxes I want to display the
subtraction of subTotal and advance(subTotal-advance) on the "balance text box" without
manually typing it in the balance text box.:confused:

Please give me an answer soon.
Thanks all.........
#programming #c#dotnet
  • Thanks for coming, but I just got it in to my brain.
  • very simple
    You have to write this in the change event of both subTotal and advance

    if(subTotal != string.Empty || advance != string.Empty){
    balance.text = Convert.ToString(int.parse(subTotal.text) - int.parset(advance));
    }
  • to do it in a cleaner way I advise using int.TryParse

Next Topics on Trending Feed

  • 4

    I think this is simple, but I didn't get a good answer though I googled it few times. This is what, I have a Windows Form Application(Visual Studio 2010) with these text boxes: subTotal, advance, balance.