hi i'm anousha and i have a big problem ive an aasignment to create a calculator in VB.net to prfrom addition and subtraction then show the results using mouse controls. Can you give me a hit how to do it plz?

Hi,

Check this sample it may be a little complicated but you can isolate the code you need out of it.

<form> <p><input type="text" name="result" size="20" style="text-align:right"> <input type="hidden" name="buffer" size="20"></p> <p> <input type="button" value="1" onclick="result.value+=1"> <input type="button" value="2" onclick="result.value+=2"> <input type="button" value="3" onclick="result.value+=3"> <input type="button" value="+" onclick="buffer.value+=result.value+'+';result,value=' ' "> </p> <p> <input type="button" value="4" onclick="result.value+=4"> <input type="button" value="5" onclick="result.value+=5"> <input type="button" value="6" onclick="result.value+=6"> <input type="button" value="-" onclick="buffer.value+=result.value+'-';result,value=' ' "> </p> <p> <input type="button" value="7" onclick="result.value+=7"> <input type="button" value="8" onclick="result.value+=8"> <input type="button" value="9" onclick="result.value+=9"> <input type="button" value="" onclick="buffer.value+=result.value+'';result,value=' ' "> </p> <p> <input type="button" value="0" onclick="result.value+=0"> <input type="button" value="C" onclick="result.value=' ';buffer.value=' ' "> <input type="button" value="=" onclick="result.value=eval(buffer.value+result.value);buffer.value=' ';"> <input type="button" value="/" onclick="result.value=eval buffer.value+=result.value+'/';result.value=' ' "> </p> </form>

Can you please clean this up, add a little detail (like what you are having trouble with) then post it as a new thread?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.