Programming Buttons

I would like to create a calculator program in Visual C++ that has 4 radio buttons for each of the 4 operations, 2 text boxes to input 2 numbers the user wants to use, and a calculate button. I have some experience in normal C++ but absolutely none in Visual.
How and where would i start programming the buttons?
With Visual C++, you can create a Windows Forms application that can do what you're after.

File->New->Project.
Select Windows Forms Application (and give it a name).

Once it loads, the visual designer for the default form will come up. If you use the 'Toolbox' (usually on the right hand side), you can add buttons, radio buttons, text boxes etc to your form just by dragging them across.

Once you've added a button to your form, for instance, selecting it in the designer will show you the properties, where you can set the text, size etc. Doing things like double-clicking the button in the designer will generate and take you to the code that handles the button-click event for that control. There you can write the logic that you want to happen when someone clicks that particular button.

Much of the required code is generated for you from the designer. For any other specific questions, I suggest checking out the MSDN forums.

Hope that helps.

P.S. Try to separate the interface layer from the logical layer. That is, the form class shouldn't actually do the various calculations...it should call appropriate methods in a class that does the calculations independently of any UI. I believe this is generally considered good practice.
Topic archived. No new replies allowed.