?
Solved

Visual C++ 6.0

Posted on 2003-11-11
4
Medium Priority
?
288 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 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

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

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…
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 viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
Suggested Courses

719 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