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

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

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

統計

留言簿(1)

閱讀排行榜

評論排行榜

Vc編的算術運算器

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)  編輯 收藏 引用


只有注冊用戶登錄后才能發表評論。
網站導航: 博客園   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>
            亚洲乱码国产乱码精品精可以看| 久久久久高清| 国产毛片一区| 久久久久久黄| 久热精品视频| 亚洲免费成人av| 一区二区三区|亚洲午夜| 欧美性事在线| 久久精品国产综合| 久久五月婷婷丁香社区| 亚洲黄页视频免费观看| 日韩视频在线观看| 国产精品永久免费| 久久躁狠狠躁夜夜爽| 久久一区欧美| 亚洲图片欧美一区| 欧美在线精品免播放器视频| 亚洲国产成人tv| 99精品99久久久久久宅男| 欧美成人一区二区三区片免费| 欧美精品三级在线观看| 亚洲欧美国产三级| 久久久噜噜噜久噜久久| 一区二区欧美亚洲| 欧美一区二区三区电影在线观看| 亚洲高清久久| 在线一区二区三区四区五区| 精品二区视频| 亚洲激情网站免费观看| 欧美午夜电影完整版| 久久久久久自在自线| 欧美精品在线一区二区| 久久久91精品国产| 欧美美女日韩| 久久人人爽国产| 欧美日本簧片| 久久亚洲视频| 欧美午夜精品久久久久久超碰| 久久手机免费观看| 欧美日韩一区二区三区在线观看免| 久久久久久亚洲综合影院红桃 | 欧美性一区二区| 久久婷婷人人澡人人喊人人爽| 欧美精品一区二区三区四区 | 欧美精品久久一区| 久久久精品久久久久| 欧美乱妇高清无乱码| 久久全国免费视频| 欧美视频中文字幕| 欧美成人免费在线| 国产欧美日韩综合| 亚洲剧情一区二区| 136国产福利精品导航| 亚洲午夜免费福利视频| 国产精品色一区二区三区| 亚洲国产91| 国内精品久久久久伊人av| 一区二区三区**美女毛片| 亚洲高清在线精品| 亚洲欧美国产另类| 亚洲少妇自拍| 欧美大片一区二区| 久久亚洲美女| 国产精品免费一区二区三区观看| 亚洲国产精品小视频| 激情视频一区二区三区| 亚洲免费小视频| 日韩亚洲欧美一区| 久久蜜桃精品| 久久精品视频在线观看| 欧美香蕉大胸在线视频观看| 亚洲国产精品久久久久久女王| 韩国成人福利片在线播放| 亚洲一区二区在线播放| 亚洲特级毛片| 欧美国产日韩一区二区在线观看| 久久人人精品| 国产精品试看| 99综合视频| aa亚洲婷婷| 欧美高清一区| 欧美国产另类| 在线观看日韩www视频免费 | 一本色道久久加勒比88综合| 亚洲精品久久久久中文字幕欢迎你| 久久精品国产亚洲一区二区| 久久国产精品网站| 国产精品自在欧美一区| 亚洲午夜激情网页| 亚洲一区免费| 欧美午夜不卡在线观看免费 | 亚洲欧美日韩精品久久久久| 欧美日韩日日骚| 亚洲人成网在线播放| 亚洲精品视频在线观看免费| 老司机午夜免费精品视频| 麻豆久久婷婷| 欧美日韩视频在线观看一区二区三区| 亚洲福利国产| 亚洲人成绝费网站色www| 久久伊人免费视频| 欧美激情免费观看| 亚洲福利视频网| 久久亚洲春色中文字幕| 欧美阿v一级看视频| 亚洲第一中文字幕| 久久全国免费视频| 免费在线国产精品| 1000部国产精品成人观看| 久久欧美肥婆一二区| 免费观看一级特黄欧美大片| 亚洲第一综合天堂另类专| 欧美.com| 亚洲日本成人女熟在线观看| 一区二区三区视频在线 | 亚洲国产电影| 亚洲精品视频在线观看免费| 欧美日韩第一区| 一本一本久久| 性欧美8khd高清极品| 国产日韩欧美在线| 久久久久国产精品www| 免费观看久久久4p| 亚洲精品视频中文字幕| 欧美日韩亚洲另类| 亚洲一区一卡| 久久嫩草精品久久久精品| 在线免费日韩片| 欧美成人精品激情在线观看| 欧美大色视频| 一区二区免费看| 国产精品美女久久福利网站| 欧美一区免费| 欧美激情一区二区三级高清视频| 亚洲美女性视频| 国产精品久久91| 性色av一区二区三区在线观看| 免费成人在线视频网站| 99视频在线观看一区三区| 国产精品国产三级国产| 欧美一级片一区| 欧美黄色一级视频| 亚洲一区3d动漫同人无遮挡| 国产亚洲欧美激情| 蜜臀av在线播放一区二区三区| 亚洲免费av电影| 久久大逼视频| 亚洲国产网站| 欧美日韩卡一卡二| 亚洲欧美日韩综合国产aⅴ| 免费成人黄色| 亚洲一区三区视频在线观看| 国模大胆一区二区三区| 欧美高清视频一区二区| 亚洲欧美日韩电影| 欧美电影免费观看高清| 亚洲一区欧美二区| 1000部国产精品成人观看| 欧美日韩在线三区| 久久精品夜色噜噜亚洲a∨| 亚洲高清在线观看| 久久狠狠婷婷| 99亚洲精品| 黄色在线一区| 欧美色偷偷大香| 久久精品中文| 99这里有精品| 欧美成人一区二区| 欧美一区二区三区电影在线观看| 欧美日韩国产123区| 亚洲欧美区自拍先锋| 亚洲国产精品va在线看黑人动漫| 先锋影音网一区二区| 亚洲人体大胆视频| 国产日韩欧美二区| 欧美日本精品一区二区三区| 久久精品视频免费播放| 日韩网站在线观看| 欧美va天堂va视频va在线| 亚洲一区二区三区四区五区午夜| 亚洲二区视频| 国产免费观看久久黄| 欧美全黄视频| 久久久欧美精品sm网站| 一区二区三区不卡视频在线观看| 美日韩丰满少妇在线观看| 亚洲一区二区三区精品视频| 亚洲国产成人久久综合| 国产乱码精品一区二区三区五月婷| 欧美国产先锋| 久久精品女人天堂| 亚洲综合视频网| 99日韩精品| 亚洲丰满少妇videoshd| 麻豆成人在线| 久久精品国产v日韩v亚洲| 宅男精品视频| 亚洲精品美女| 伊人色综合久久天天五月婷| 国产免费亚洲高清|