Solved

Visual C++ 6.0

Posted on 2003-11-11
4
280 Views
Last Modified: 2010-04-02
Hey
I've just been checking out Visual C++ 6.0, and was wondering how can i add,subtract etc, numbers which are inputed into edit boxes,
e.g. i have 4 edit boxes, box1=number1,box2=number2, box3=add,subtract..etc, and box 4 is the sum of number1&number2.
So when the user has inputed the values, he can then click a button which will calculate the value and display it in editbox 4.
how could i go about doing this?
0
Comment
Question by:cpu4ghz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 32

Accepted Solution

by:
jhance earned 50 total points
ID: 9721379
Well, the process is simple:

1) You get the user input from these edit boxes and validate the data.
2) You then convert that text input into a suitable number.
3) You perform your mathematical operations on those numbers.
4) You then display the results.


BTW: This is not really a C++ language question and is off-topic here.
0
 
LVL 13

Expert Comment

by:SteH
ID: 9721384
simple approach:
Assign numeric variables to the editboxes 1,2 and 4 (long, double) with the ClassWizard (Ctrl+W) and a string var to editbox 3.

After calling
UpdateData (TRUE)
you can use
your variables. Depending on the value of var3 you add, subtract etc var1 and var2 and store the result in var4
A call to
UpdateData (FALSE) puts the result of var4 into editbox.
0
 
LVL 9

Expert Comment

by:tinchos
ID: 10248932
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Accept: jhance {http:#9721379}

Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Tinchos
EE Cleanup Volunteer
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to split this in C++ 4 130
Embarcadero WebBroker REST server endpoint parameters 2 116
designing in object programming 12 132
Can Live bindings change TGrid Cell Colour ? 1 64
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question