i am building a calculator and i need help with some stuff.
I want my program to display every key i hit on it (1,2,3,+,-,/,*,=) in textbox1, and then giving me the ANSWER ONLY in textbox2. Can anyone help me?
10-05-2001, 09:06 PM
I will do the first part for you:
text1.text=text1 & command1(index number here).caption
I am assuming your buttons are going to be in a control array. They would not have to be I suppose, but that would be the simplest way to handle this I think. I will let you work out the equation parser on your own. images/icons/smile.gif
Just a little more here on the control array aspect of this. If your command buttons are in an array then you only need that line of code in one place. Otherwise you will have to repeat that one line for as many buttons as you have on the calculator.
Time is the best teacher; unfortunately it kills all its students.<P ID="edit"><FONT class="small"><EM>Edited by dcl3500 on 10/05/01 10:09 PM.</EM></FONT></P>
Thanx for the display code thing, but i am new to the visual basic scene here, and am wondering what a control array is and how do you declare it?
10-05-2001, 09:28 PM
Here read through this post first. (http://www.visualbasicforum.com/bbs/showflat.php?Cat=&Board=tu&Number=35390&page=0&view=collapsed&sb=5&o=93&part=) Then post back with any questions you might have. Fortunately oops scratch this part(<font color=red>BillSoo</font color=red>) and insert this part <font color=purple>Karimahta</font color=purple> (sorry Karimahta and Bill for the incorrect credits) did this fine tutorial for all of us to learn from.
Time is the best teacher; unfortunately it kills all its students.<P ID="edit"><FONT class="small"><EM>Edited by dcl3500 on 10/05/01 11:01 PM.</EM></FONT></P>