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

Tauruser

Enjoy Every Day
posts - 34, comments - 95, trackbacks - 0, articles - 5
  C++博客 :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

MFC ComboBox 使用方法(轉載)

Posted on 2007-02-28 10:29 Tauruser 閱讀(18788) 評論(1)  編輯 收藏 引用 所屬分類: MFC

MFC ComboBox 使用方法(轉載)


Combo box controls are space savers. Wherever there is no need for a multi-select from a list of items, combo box is a good choice in such places. This article " CComboBox Example" explains how to use the MFC CComboBox class for manipulation of a list of strings.

CComboBox Example - Initializing a Combo Box:

?? It is assumed that the readers of the sample have already created a dialog box (either in a dialog based application or SDI/MDI application) and placed a combo box control from the controls toolbox on the Resource Editor.

?? After placing the combo box control on the dialog box, open the class wizard by pressing Ctrl + W keys or Menu --> View --> ClassWizard. In the Member Variables tab, Add a Variable for the CComboBox class. This CComboBox example assumes that the variable name is,

????? CComboBox? m_cbExample;

?? This m_cbExample will be used further in our CComboBox example MFC code.

CComboBox Example - Adding Items to a Combo Box:

?? The function AddString is used for adding items to a combo box. If there is a constant set of data, these values can also be added in the Resource Editor itself. The Combo Box control properties dialog has a tab for adding data. Otherwise the data can be added as follows.

??? m_cbExample.AddString("StringData1");
??? m_cbExample.AddString("StringData2");
??? m_cbExample.AddString("StringData3");

CComboBox Example - Retrieving Items from a Combo Box:

?? Usually
a requirement for retrieving items from the combo box will arise from selecting the data. This article also assumes the same. Now the data selected in a combo box needs to be retrieved.

?? To do this, the first step is to find out the index of the selected item inside the combo box control.
Then the item at the corresponding position needs to be pulled out as follows.


??? int nIndex = m_cbExample.GetCurSel();
??? CString strCBText;

??? m_cbExample.GetLBText(
nIndex, strCBText);


?? In the above CComboBox example code, the value will be retrieved and stored in strCBText variable. There is another overloaded version for GetLBText. But the version which uses CString is the easiest one.


CComboBox Example - Finding Items inside a Combo Box:


?? This kind of Find operations on a Combo box will most probably be useful in programs that dynamically modify the values in a combo box. The function FindStringExact is used to find the exact string match inside a combo box.


??? int nIndex = m_cbExample.FindStringExact(0, "Value to be found");

?? The string position inside the combo box control is the return value. It returns CB_ERR if it was unsuccessful in finding the string.


CComboBox Example - Deleting Items from a Combo Box:


??? This operation can be done by using the CCombobox member function DeleteString. This function needs the index of the item inside the combo box.


???? m_cbExample
.DeleteString(nIndex);

Feedback

# re: MFC ComboBox 使用方法(轉載)  回復  更多評論   

2007-05-30 13:32 by
@魔

只有注冊用戶登錄后才能發表評論。
網站導航: 博客園   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>
            1024精品一区二区三区| 亚洲国产欧美久久| 欧美一级电影久久| 亚洲亚洲精品在线观看 | 亚洲一二三级电影| 国产精品国产三级国产专播精品人 | 狠狠干成人综合网| 久热精品在线视频| 欧美sm极限捆绑bd| 日韩亚洲视频在线| 一区二区三区欧美亚洲| 国产精品普通话对白| 欧美一区二区在线看| 久久精品三级| 亚洲国产综合91精品麻豆| 亚洲国产综合在线| 欧美视频在线不卡| 久久精品道一区二区三区| 久久久久欧美| 99这里只有久久精品视频| 亚洲视频一区二区在线观看| 国产亚洲成人一区| 亚洲国产精品久久久久秋霞蜜臀| 欧美日韩一区二区三区免费看| 性欧美精品高清| 久久中文字幕导航| 午夜激情综合网| 久久午夜色播影院免费高清| 999亚洲国产精| 欧美一区二区三区播放老司机| 亚洲破处大片| 亚洲综合成人在线| 亚洲精品久久视频| 欧美尤物巨大精品爽| 日韩亚洲欧美一区| 久久久久久电影| 亚洲一区二区三区欧美| 鲁大师成人一区二区三区| 亚洲欧美日韩一区二区| 欧美插天视频在线播放| 久久精品亚洲热| 欧美日韩在线播| 亚洲国产精品久久91精品| 国产一区深夜福利| 亚洲午夜激情| 一区二区三区四区五区视频| 欧美在线综合| 翔田千里一区二区| 欧美日韩一卡二卡| 亚洲激情综合| 亚洲电影有码| 久久久亚洲午夜电影| 欧美在线国产| 国产精品你懂的在线欣赏| 亚洲久色影视| 亚洲免费观看高清完整版在线观看| 久久精品一区二区| 久久国产视频网站| 国产欧美日韩不卡免费| 一区二区欧美日韩| 亚洲一区二区三区四区视频| 欧美激情综合在线| 亚洲人成77777在线观看网| 亚洲国产一区二区在线| 久久久久久九九九九| 麻豆精品精华液| 在线国产精品一区| 久久久精品日韩| 久久综合伊人| 在线电影一区| 蜜臀va亚洲va欧美va天堂| 欧美成人高清| 亚洲欧洲一区二区在线观看 | 在线亚洲自拍| 亚洲女人小视频在线观看| 欧美日韩一区二区在线播放| 亚洲卡通欧美制服中文| 中国成人在线视频| 国产精品久久9| 亚洲欧美精品| 久久青草久久| 亚洲精品一二区| 欧美日韩免费在线观看| 亚洲视频免费观看| 久久精品视频在线播放| 一区二区视频欧美| 麻豆精品一区二区综合av| 亚洲区欧美区| 亚洲欧美美女| 在线电影国产精品| 欧美日韩理论| 亚洲欧美春色| 欧美激情1区| 亚洲欧美激情在线视频| 国产午夜亚洲精品羞羞网站| 久久综合给合| 亚洲深夜福利网站| 久久久久免费| 99精品免费| 国产一区91精品张津瑜| 蜜桃av一区二区| 亚洲一区二区视频在线观看| 久久免费视频在线观看| 亚洲九九爱视频| 国产欧美一区二区视频| 欧美大片免费久久精品三p | 欧美在线不卡视频| 99re这里只有精品6| 久久久久久久久综合| 日韩一级黄色av| 黄色一区二区在线| 欧美午夜激情在线| 久久资源av| 亚洲欧美网站| 日韩系列欧美系列| 欧美多人爱爱视频网站| 亚洲欧美成人一区二区三区| 亚洲激情第一页| 国产午夜一区二区三区| 欧美日韩亚洲国产精品| 久久青青草综合| 亚洲欧美日韩一区二区在线| 91久久久国产精品| 美女被久久久| 久久精品国产视频| 亚洲一区3d动漫同人无遮挡| 亚洲国产精品一区二区www在线| 国产精品久久久久永久免费观看| 欧美va亚洲va国产综合| 久久精品国产综合| 性刺激综合网| 亚洲欧美日韩网| 亚洲天堂男人| 一区二区三区精品视频在线观看 | 亚洲男人的天堂在线| 日韩一区二区免费看| 亚洲国产精品成人一区二区| 精品二区视频| 激情伊人五月天久久综合| 国产亚洲欧美日韩美女| 国产精品主播| 国产伦精品一区二区三区| 国产精品成人一区二区三区夜夜夜| 欧美精品久久久久a| 欧美日韩的一区二区| 欧美高清在线观看| 欧美另类在线播放| 欧美日韩国产免费| 欧美日韩国产成人在线免费| 欧美寡妇偷汉性猛交| 欧美黄色免费网站| 欧美大片一区二区| 欧美jjzz| 欧美日韩亚洲一区三区 | 久久aⅴ国产欧美74aaa| 久久福利一区| 可以看av的网站久久看| 欧美成人69av| 欧美人成免费网站| 国产精品久久久999| 国产精品视频xxx| 国产视频一区在线| 一区二区三区我不卡| 亚洲国产精品一区二区第四页av| 亚洲精品乱码久久久久久黑人| 999亚洲国产精| 香蕉免费一区二区三区在线观看| 欧美一区高清| 欧美成人日本| 日韩亚洲国产欧美| 亚洲主播在线观看| 美女精品一区| 欧美系列一区| 激情久久久久久久| 亚洲精品免费看| 午夜亚洲性色福利视频| 久久综合网hezyo| 亚洲欧洲在线一区| 亚洲自拍偷拍一区| 女人香蕉久久**毛片精品| 欧美色视频在线| 狠狠久久婷婷| 亚洲午夜在线观看| 噜噜噜躁狠狠躁狠狠精品视频| 亚洲韩国一区二区三区| 午夜精品免费视频| 欧美激情综合网| 韩曰欧美视频免费观看| 亚洲深夜福利在线| 六十路精品视频| 亚洲视频999| 鲁大师成人一区二区三区| 国产精品乱子久久久久| 亚洲人人精品| 久久久一本精品99久久精品66| 日韩亚洲精品在线| 久久综合久久久| 国产私拍一区| 亚洲中字在线| 99精品国产在热久久|