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

成功∑信念&毅力@勤勞$堅(jiān)持

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

統(tǒng)計(jì)

留言簿(1)

閱讀排行榜

評(píng)論排行榜

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

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 醬豆腐 閱讀(410) 評(píng)論(0)  編輯 收藏 引用


只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。
網(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>
            午夜欧美不卡精品aaaaa| 欧美中在线观看| 在线日本欧美| 亚洲资源av| 亚洲欧洲日韩在线| 亚洲激情午夜| 国产精品99免视看9| 欧美一区二区高清| 一区二区三区国产精华| 欧美一区二区三区婷婷月色 | 国产精品久久久久久户外露出 | 国产亚洲精品久久久| 亚洲一区二区三区免费视频| 久久国产精品久久w女人spa| 欧美在线啊v| 一区二区三区免费观看| 国产一区二区高清视频| 国产精品va在线播放| 欧美极品一区二区三区| 美国十次成人| 国产一区二区三区无遮挡| 亚洲欧美日韩第一区| 亚洲肉体裸体xxxx137| 亚洲欧美另类国产| 99精品黄色片免费大全| 亚洲国产欧美一区二区三区丁香婷| 国产精品劲爆视频| 欧美日韩色一区| 亚洲成人影音| 国产农村妇女精品| 国产精品久久久久久福利一牛影视| 欧美成人综合| 最新中文字幕一区二区三区| 久久久夜色精品亚洲| 9l国产精品久久久久麻豆| 亚洲欧洲精品天堂一级| 亚洲国产精品va在线观看黑人 | 99在线|亚洲一区二区| 欧美一区二区三区的| 欧美成人性网| 欧美一区二区三区免费视| 亚洲欧美中文日韩在线| 在线亚洲精品| 99riav1国产精品视频| 99精品福利视频| 亚洲卡通欧美制服中文| 日韩亚洲欧美成人一区| 在线视频精品| 国产精品美女久久久久av超清| 国产精品大片免费观看| 国产精品久久久久久亚洲调教 | 亚洲经典自拍| 在线观看日韩专区| 亚洲国产精品久久久久婷婷884| 国产一区二区三区在线观看免费| 黑人一区二区三区四区五区| 在线欧美小视频| 一区二区三区欧美视频| 亚洲一级免费视频| 久久久精品午夜少妇| 欧美激情精品久久久久久| 亚洲高清不卡一区| 亚洲免费在线看| 美女国产一区| 亚洲国产精品视频| 亚洲香蕉伊综合在人在线视看| 一区二区在线看| 欧美第一黄网免费网站| 欧美日韩在线免费| 国产精品第三页| 一区精品在线| 亚洲欧美国产日韩天堂区| 国产精品永久| 亚洲黄页一区| 在线日韩av永久免费观看| 欧美日韩精品一区视频| 国产精品亚洲视频| 亚洲激情视频网| 久久国产加勒比精品无码| 久久精品在线视频| 欧美日韩国产色视频| 国产一区日韩一区| 红桃视频成人| 亚洲图片在线观看| 免费成人av资源网| 久久婷婷麻豆| 亚洲一区在线直播| 欧美顶级大胆免费视频| 香蕉久久精品日日躁夜夜躁| 久久精品国产第一区二区三区最新章节| 亚洲第一精品福利| 午夜日韩福利| 欧美日韩一区二区三区免费| 欧美日韩综合视频网址| 亚洲国产精品va在线观看黑人 | 国产精品99久久不卡二区| 久久久国产一区二区| 欧美三区在线观看| 亚洲高清视频一区| 一本色道久久加勒比88综合| 久久视频免费观看| 欧美风情在线观看| 亚洲日本中文字幕区| 欧美插天视频在线播放| 久久精品99国产精品| 国产精品久久激情| 亚洲一区制服诱惑| 在线一区免费观看| 欧美午夜免费影院| 亚洲——在线| 夜夜夜久久久| 久久精品国产亚洲a| 国产精品日韩一区二区三区| 欧美一级一区| 欧美在线一级va免费观看| 国产欧美日韩综合一区在线观看| 亚洲专区在线视频| 中国成人黄色视屏| 在线观看日韩av电影| 中国成人在线视频| 一本久道久久久| 久久影院午夜片一区| 欧美一区2区三区4区公司二百| 欧美久久一区| 欧美韩日视频| 影音先锋久久精品| 亚洲综合不卡| 亚洲私人黄色宅男| 欧美日韩视频在线观看一区二区三区| 欧美福利一区二区三区| 激情综合激情| 久久人人97超碰精品888| 久久精品国产亚洲a| 国产日韩欧美视频在线| 亚洲综合欧美日韩| 亚洲视频在线观看三级| 欧美激情一级片一区二区| 欧美wwwwww| 91久久精品日日躁夜夜躁国产| 麻豆久久久9性大片| 亚洲第一在线| 亚洲精品一区二区三区四区高清 | 久久久久久久性| 久久视频一区二区| 国精品一区二区三区| 久久蜜桃香蕉精品一区二区三区| 毛片一区二区三区| 亚洲黄一区二区三区| 欧美精品18| 亚洲天堂网在线观看| 亚洲一区二区三区在线观看视频 | **欧美日韩vr在线| 宅男精品视频| 这里只有精品视频在线| 免费在线观看成人av| 欧美成人资源| 91久久中文字幕| 欧美日本免费| 在线一区二区三区四区| 久久av一区二区三区漫画| 国产一区二区三区久久 | 韩国久久久久| 免费人成网站在线观看欧美高清| 欧美成人免费观看| 99re66热这里只有精品4| 欧美精品 国产精品| 中文精品99久久国产香蕉| 欧美在线播放高清精品| 亚洲国产成人不卡| 欧美日韩麻豆| 午夜视频一区二区| 欧美激情视频网站| 在线中文字幕一区| 国产在线欧美日韩| 欧美成人精品h版在线观看| 一本久道久久综合狠狠爱| 欧美激情中文不卡| 日韩视频免费观看| 一区二区三区日韩在线观看 | 欧美激情精品久久久| 中文在线一区| 麻豆国产精品777777在线| 亚洲最黄网站| 国产揄拍国内精品对白| 欧美高清在线一区| 午夜精品久久久久久99热软件| 欧美电影在线免费观看网站| 亚洲欧美一区二区三区在线 | 亚洲精品在线观看免费| 国产精自产拍久久久久久蜜| 欧美va天堂| 久久国产精品99久久久久久老狼| 91久久精品一区| 久久精品日产第一区二区| 一本久道久久综合婷婷鲸鱼 | 久久噜噜亚洲综合| 亚洲欧美高清| 一本色道久久综合亚洲精品不| 一色屋精品视频免费看| 国产精品亚洲欧美|