If this is an easy question please excuse me. I am new to VB.NET and have made a few small programs that randomize numbers but I want to learn some math now and need a working code example.
I want to have a series of text boxes 1 thru 10. The math formula I need help with is below. If it's easy enough I would like the calculations to occur when the numbers are typed in the text boxes by the user like an on change event. If it's easier to use a button to do all the caluclations after the numbers have been entered in the text boxes that would be ok too.
textbox1 minus textbox2 plus textbox3 = textbox4
textbox4 minus textbox5 plus textbox6 = textbox7
textbox7 minus textbox8 plus textbox9 = textbox10
Thanks for help with this.
Last edited by teamdad; Jun 13th, 2004 at 08:19 PM.
Well i personally would create variables for user input.
But my code would look like this:
dim sngInput1 as single
dim sngInput2 as single
dim sngInput3 as single
dim sngInput5 as single
dim sngInput6 as single
dim sngInput8 as single
dim sngInput9 as single
dim sngoutput1 as single
dim sngoutput2 as single
dim sngoutput3 as single
I would use a single data type b/c I dont know how big or small the numbers the users are inputing are.
I would also use labels for the output numbers b/c i dont see any reason why they need to be textboxes since the user is not inputing anything into them.
If you want the code to execute when the textchanges just copy and paste the code for the given equation in each of the 2 or 3 textboxes that are in the formulas...
hope this helped
DDT
“The sky above the port was the color of television, tuned to a dead channel.”
---
u can make a button and double click it, then add that code.
i realize this isn't an advanced way of doing things, but this question is coming from a beginner who probably wants to learn just one thing at a time.
Ideally, indeed the output should be in labels, and the input should be in numeric updowns
Andy thanks for the project files, both you and ramezb84 hit the nail on the head with what I was trying to do with the program I am working on. I didn't want to let it out but I guess among other programmers it's safe to say what your working on. It's a program to help those like me that have a problem balancing their check book.
The code works perfect and now I have the rest of the day to work out the rest of the program. Your contributions helped me understand more about VB and that's what I needed.
Here's the link to my other program that I mentioned I had made. Shoot me an email and i'll reply with the link to a free copy of it.
glad you liked it!! just keep in mind that programming a math application is NOT rocket science. Simply sit down and write out what the program is to do ultimately, and work backwards. As you progress with it, you'll find corners you can cut and round out your app to a nice smooth finish.