Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Visual C++ 6.0

Posted on 2003-11-11
4
Medium Priority
?
293 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
3 Comments
 
LVL 32

Accepted Solution

by:
jhance earned 200 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

Industry Leaders: 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

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
Article by: evilrix
Looking for a way to avoid searching through large data sets for data that doesn't exist? A Bloom Filter might be what you need. This data structure is a probabilistic filter that allows you to avoid unnecessary searches when you know the data defin…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
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.

783 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