青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

成功∑信念&毅力@勤勞$堅持

業(yè)精于勤,荒于嬉;行成于思,毀于隨. 天下皆知取之為取,而莫知與之為取.

統(tǒng)計

留言簿(1)

閱讀排行榜

評論排行榜

Vc編的算術(shù)運算器

This tutorial could well be the simplest windows program you could ever write.  All you need to understand this tutorial is the basics of windows messaging.  This tutorial is about the CButton class, and how to get a simple button working.

This tutorial simply takes input for two numbers and depending on what button you click, does the math.  ie. if you enter 1 and 2, then click on 'Plus' the answer will be 3.  Pretty basic.

To create this program first we need to get the framework laid out.  Now 99.9% of the time, you will be using buttons via a dialog box so that is where we will start.  Open up the AppWizard and create a new project titled ButtonDemo.  Just create a basic dialog box without any document / view architecture.


Then click on the ResourceVew tab in the 'Workspace' window.  Proceed to edit the dialog box IDD_BUTTONDEMO_DLG.  It will already contain the Buttons 'Ok' and 'Cancel'.  Delete the 'TODO :' message and the 'Cancel' button so we can get to work.

Just drag n' drop the buttons needed, in this example 'Plus' and 'Minus'.  Then select and right click to edit their properties.  The MFC keeps track of these buttons by their unique ID, a macro located in the "Resource.h" file.  For code clarity, change the name of the ID to ID_BUTTON_ADD and modify the caption of the button.


Next, let's add the Edit boxes to house the values to be added or subtracted, do this in a very similar manner to the way you added the buttons.  Just drag and drop them in and then modify their ID.  We will need an Edit box for the left and right side of the equation as well as one to house the answer.  Just for clarity to the end user, check the 'disable' property of the last Edit box.  Since we won't directly be able to specify the answer.  We will also add a Static control for the equals sign.  Just drop one in and then change the caption.


Now that our buttons and are in place we need to wire them into our application.  We do this via the class wizard.  (Control + W)  Click on the Member Variables tab and proceed to add the variables m_nX, m_nY, and m_nAnswer.  All integers; these will hold the values inputted from the Edit controls. 


Then click on the Message Maps tab.  And add a new function for the object ID ID_BUTTON_ADD and  ID_BUTTON_SUBTRACT message BN_CLICK.  This create a function is called whenever that button is clicked once.  Denoted by OnButtonAdd and OnButtonSubtract.


Now that we have created our buttons this is all the code we need to write to get this program working.  It is fairly self explanatory: what we did was create two functions to be called whenever the respective buttons were pressed.  The UpdateData (BOOL) functions are used to manage the data in the Edit boxes of the dialog.  UpdataData (TRUE), 'updates' the member variables linked to the Edit boxes to whatever is the current value.  UpdataData (FALSE), updates the Edit box to whatever our variable is.
void CButtonDemoDlg::OnButtonAdd()
            {
            UpdateData (TRUE);
            m_nAnswer = m_nX + m_nY;
            UpdateData (FALSE);
            }
            void CButtonDemoDlg::OnButtonSubtract()
            {
            UpdateData (TRUE);
            m_nAnswer = m_nX - m_nY;
            UpdateData (FALSE);
            }
            

That is it!  All we need to do to implement a simple button.


posted on 2008-05-21 21:49 醬豆腐 閱讀(411) 評論(0)  編輯 收藏 引用


只有注冊用戶登錄后才能發(fā)表評論。
網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            久久久久成人网| 久久精品1区| 欧美婷婷六月丁香综合色| 一本色道久久综合亚洲精品不| 亚洲国产精品久久久久| 欧美高清在线播放| 一区二区三区产品免费精品久久75 | 国产一区二区精品丝袜| 久久久xxx| 久久综合狠狠综合久久激情| 亚洲麻豆视频| 一本色道久久综合狠狠躁篇的优点| 欧美少妇一区| 久久精品国产成人| 久久亚洲精品一区二区| 99这里有精品| 欧美在线三区| 亚洲伦理精品| 亚洲一区在线免费| 亚洲高清视频的网址| 日韩亚洲在线观看| 国内精品久久久久久久97牛牛| 欧美国产高潮xxxx1819| 国产精品女人网站| 美女图片一区二区| 欧美日韩一区二区视频在线 | 好看的日韩视频| 亚洲激情网站| 国产欧美日韩激情| 亚洲国产精品va| 国产噜噜噜噜噜久久久久久久久 | 亚洲日本在线观看| 亚洲男人的天堂在线aⅴ视频| 亚洲国产导航| 亚洲在线视频免费观看| 亚洲人永久免费| 午夜亚洲一区| 亚洲一区不卡| 欧美大片91| 久久青草久久| 国产欧美精品一区aⅴ影院| 亚洲黄网站黄| 一区视频在线| 欧美中文字幕久久| 亚洲欧美久久| 欧美久久精品午夜青青大伊人| 久久综合国产精品台湾中文娱乐网| 欧美日韩国产一区精品一区 | 亚洲一区二区视频在线| 另类欧美日韩国产在线| 久久久国际精品| 国产日韩欧美在线| 在线一区二区三区四区五区| 亚洲美女毛片| 欧美激情影院| 亚洲国产婷婷香蕉久久久久久| 伊人久久成人| 久久久久久久久久久成人| 久久国产主播| 国产亚洲毛片在线| 亚洲欧美日韩国产| 午夜亚洲性色视频| 国产精品卡一卡二卡三| 一区二区三区免费看| 亚洲午夜精品久久| 欧美日韩爆操| 一个色综合导航| 中文精品视频一区二区在线观看| 欧美国产在线电影| 亚洲国产日韩欧美在线99| 亚洲青色在线| 欧美久久在线| 一本色道久久综合亚洲精品不| 日韩一级精品| 欧美日韩亚洲一区三区| 在线天堂一区av电影| 性欧美超级视频| 狠狠色综合日日| 久久先锋资源| 亚洲精品乱码久久久久| 亚洲私人黄色宅男| 国产麻豆精品久久一二三| 亚洲欧美另类中文字幕| 久久这里只有| 最新国产拍偷乱拍精品| 欧美日韩亚洲高清一区二区| 亚洲一二三四久久| 久久久久久亚洲精品杨幂换脸 | 国产欧美激情| 久久天天躁夜夜躁狠狠躁2022| 亚洲国产成人精品久久久国产成人一区| 亚洲人成网站在线观看播放| 欧美视频一区二| 欧美影视一区| 亚洲人成在线免费观看| 午夜精品电影| 亚洲黄色视屏| 国产精品乱码| 欧美aaaaaaaa牛牛影院| 亚洲午夜精品久久| 男女激情久久| 亚洲欧美日韩精品一区二区| 精品动漫3d一区二区三区免费| 欧美日韩福利视频| 欧美一区二区三区在线免费观看| 亚洲成色www久久网站| 亚洲一级二级| 在线看视频不卡| 国产精品爽爽爽| 欧美成年视频| 欧美在线不卡| 日韩午夜精品视频| 美乳少妇欧美精品| 亚洲欧美日韩精品久久| 亚洲精品日韩久久| 国产视频一区三区| 欧美三级电影网| 免费短视频成人日韩| 亚洲欧美日韩久久精品| 亚洲精品资源| 亚洲电影免费观看高清完整版在线观看| 亚洲在线电影| av72成人在线| 亚洲国产精彩中文乱码av在线播放| 国产精品三区www17con| 欧美激情一区三区| 免费欧美在线视频| 久久精品亚洲一区二区三区浴池| 中文在线资源观看网站视频免费不卡| 欧美不卡高清| 久久夜色精品一区| 久久国产精品久久国产精品| 亚洲免费视频一区二区| 亚洲免费观看高清完整版在线观看熊| 国产一区二区三区四区在线观看| 国产精品久久久久影院色老大| 欧美激情精品久久久| 免费的成人av| 免费在线看一区| 久久综合久久美利坚合众国| 久久久精品一区| 久久久999精品| 久久精品欧洲| 久久久久九九九九| 久久爱www.| 久久久777| 蜜臀a∨国产成人精品| 麻豆精品一区二区av白丝在线| 久久久久久69| 美女啪啪无遮挡免费久久网站| 快播亚洲色图| 欧美电影在线观看完整版| 欧美精品三区| 欧美性色综合| 国产欧美三级| 激情成人综合网| 亚洲人成艺术| 亚洲一级高清| 久久久久久久999精品视频| 久久偷看各类wc女厕嘘嘘偷窃| 女生裸体视频一区二区三区| 欧美激情亚洲视频| 99re6这里只有精品| 亚洲男女自偷自拍| 久久资源在线| 欧美精品午夜| 国产女优一区| 亚洲成人在线网| a91a精品视频在线观看| 欧美一级淫片播放口| 老色鬼精品视频在线观看播放| 亚洲大胆人体视频| 亚洲私拍自拍| 久久野战av| 欧美午夜在线视频| 国外成人性视频| 亚洲免费精品| 久久久久国产精品人| 亚洲国产天堂久久综合网| 亚洲在线免费视频| 男女精品网站| 国产精品一区二区你懂得 | 欧美体内she精视频在线观看| 国产欧美日韩在线播放| 亚洲经典三级| 久久精品72免费观看| 亚洲乱码久久| 久久久.com| 国产精品一二三四| 夜夜狂射影院欧美极品| 久久国产欧美| 日韩午夜免费视频| 久久噜噜噜精品国产亚洲综合| 欧美午夜精品伦理| 亚洲日本理论电影| 另类尿喷潮videofree| 亚洲一二区在线| 欧美精品首页| 亚洲激情在线观看| 久久综合精品一区|