Solved

Visual C++ 6.0

Posted on 2003-11-11
4
254 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
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 be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

896 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now