tags:

views:

144

answers:

3

how to make a calculator in GUI (.NET)

+15  A: 
Process.Start("calc.exe")

Also, look here for tips if you need a more customized version.

jball
does the job ;)
Olli
Quick, easy, no hassle, works across all versions of Windows since 3.1, guaranteed to work in future versions also, loooool :-)
Darin Dimitrov
LOL? (at least 15 characters, so here goes)
casablanca
You could even make the following improvement in v2: `Process.Start("calc");`. Less code to maintain, it will work even if Microsoft decides to change the default extension of their executables in Windows 2075.
Darin Dimitrov
+4  A: 

I agree that you should start it before asking for help, but this might help you, this tutorial in .net c# will show you how.

http://www.dreamincode.net/forums/topic/32968-basic-calculator-in-c%23/#/

Lobsterm
+1  A: 

The hard way is to have a text field for the number input/output and buttons for numbers, each of the calculator functions (i.e. +, -, /, *, =, square root, etc), and whatever else you want on the calculator. You then need to edit each button so that on the click event for that button it reads the text input, performs the corresponding operation and prints the result to that text field (or another text field if you want both input and output fields).

The easy way is to just use the Windows calculator.

Mike Webb