佳礼资讯网

 找回密码
 注册

ADVERTISEMENT

搜索
查看: 1640|回复: 4

用C++->Windows Application 做一个Calculater出来...

[复制链接]
发表于 27-9-2009 09:18 AM | 显示全部楼层 |阅读模式
Q1.        (SIMPLE CALCULATOR) Create a Dialog Box with the following layout:
A Dialog Box showing the calculation result view pop up when user press the button.



我的老师叫我们做,可是我都没idea..不知道要怎样下手。。 请大哥们帮帮我。。 我想学window application.. 之前有学过 C, C#, XNAGS, C++之类的。。我想知道怎样Get Input, build button in windows application..
回复

使用道具 举报


ADVERTISEMENT

发表于 28-9-2009 01:47 PM | 显示全部楼层
原帖由 liccowee 于 27-9-2009 09:18 AM 发表
我的  [老师]  叫我们做,可是  [我都没idea]   ..不知道要怎样下手。。


上面我已经标示出你的问题所在。

do{
if(老师什么都没教,而你不懂,那是老师的责任,你应该去问老师怎么做,毕竟老师是有领薪水的)
{
    你不明白 = true;
}
else if(老师有教而你不懂,那是你自己的错,你应该去再向老师请教,挨老师批是你该付出的代价,毕竟老师在教时你没听课,或者有听课却在不懂的时候没有向老师发问)
{
    你不明白 = true;
}

}while(你不明白);

如果你还是不明白,那你将会在以上的loop里面轮回不得超生,明白了你就可以break loop了。

至于你该从哪里开始?再看看这段文字:“ (SIMPLE CALCULATOR) Create a Dialog Box with the following layout:”。

万丈高楼从地起,你连第一步都没跨出去,后面的计划谈得再多也枉然。就从那个GUI开始吧(毕竟你的programming背景如此辉煌多彩,没理由你连最基本的一个GUI也没办法做出来吧?),然后去了解那些components,例如你在Edit Box里面输入的数值储存在哪里?如何获得那些数值?如何把那些数值转换成你需要的格式?如何对应Button的event?诸如此类。
回复

使用道具 举报

发表于 28-9-2009 03:15 PM | 显示全部楼层

回复 1# liccowee 的帖子

你目前最需要的, 就是了解如何运用 win32 API。 以你的背景来看, 你至少对基本的编程都有了一定的概念。

我建议你参考这个网站

http://www.winprog.org/tutorial/start.html

了解 component, event handling 等等。
回复

使用道具 举报

发表于 28-9-2009 03:37 PM | 显示全部楼层
WINDOW APPS应该从VB学起比较容易吧.....
看到问功课的直接BYPASS掉
回复

使用道具 举报

发表于 19-1-2010 09:55 PM | 显示全部楼层
let me try help u...

first, create 3 textbox, 4 button name it as txt1,txt2,txt3,add,minus,multiply,divide

open form load,

keyin-->

int x,y;
int total;

txt1.text = x;
txt2.text = y;
txt3.text = total;

then

open add button type command :

x + y = total;

open minus button type command :

x - y = total;

open multiply button type command :

x * y = total;

open divide button type command :

x / y = total;

i dunno whether correct or not...u can hv a try
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

 

ADVERTISEMENT



ADVERTISEMENT



ADVERTISEMENT

ADVERTISEMENT


版权所有 © 1996-2026 Cari Internet Sdn Bhd (483575-W)|IPSERVERONE 提供云主机|广告刊登|关于我们|私隐权|免控|投诉|联络|脸书|佳礼资讯网

GMT+8, 10-5-2026 01:01 AM , Processed in 0.079920 second(s), 10 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表