Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

wait for all fields to be filled in before calculating

Status
Not open for further replies.

Saturn57

Programmer
Aug 30, 2007
275
CA
I would like a form to calculate values any time a field is changed however those calculations are based on all of some specific fields to be filled in to perform the calculation. How can i have an automatic calculation to occur everytime a field is changed but hold off that calculation until all required fields are filled in. Is there a way to use an if statement with an and ex:
if (text1 and text 2 and text 3.... > 0)
 
Hook up a changed event to each control (for a textbox it's 'TextChanged') that calls your calculate method. Within your calculate method just specify the conditions eg.

Code:
if (Convert.ToInt32(Text1.Text) > 0 && Convert.ToInt32(Text2.Text) > 0 && etc...) then
   ...

Ryan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top