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

Tauruser

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

MFC ComboBox 使用方法(轉(zhuǎn)載)

Posted on 2007-02-28 10:29 Tauruser 閱讀(18768) 評(píng)論(1)  編輯 收藏 引用 所屬分類(lèi): MFC

MFC ComboBox 使用方法(轉(zhuǎn)載)


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 使用方法(轉(zhuǎn)載)  回復(fù)  更多評(píng)論   

2007-05-30 13:32 by
@魔
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <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>
            极品中文字幕一区| 久久国产精品一区二区三区四区| 99re在线精品| 亚洲日本va在线观看| 亚洲免费av电影| 一本到12不卡视频在线dvd| 一区二区三区产品免费精品久久75| 一区二区三区 在线观看视| 亚洲图片在区色| 亚洲综合视频网| 欧美一级久久久久久久大片| 久久经典综合| 欧美成人精品在线观看| 亚洲人精品午夜| 最新国产成人av网站网址麻豆| 亚洲另类自拍| 欧美中文字幕视频| 欧美高清在线一区| 性欧美暴力猛交另类hd| 蜜臀91精品一区二区三区| 亚洲精品一区中文| 欧美亚洲三级| 欧美黑人国产人伦爽爽爽| 国产精品久久久久9999高清| 韩国三级电影一区二区| 一区二区免费在线播放| 久久综合免费视频影院| 亚洲精选在线观看| 久久久久一区| 欧美三区美女| 国产亚洲一区二区在线观看| 99一区二区| 美日韩精品免费| 中文精品视频一区二区在线观看| 欧美在线观看一区| 国产精品久线观看视频| 亚洲国产欧美在线人成| 久久精品夜色噜噜亚洲a∨| 久久不射中文字幕| 亚洲欧洲另类| 牛牛精品成人免费视频| 国产婷婷色一区二区三区在线| 亚洲精选大片| 欧美成人国产一区二区| 欧美在线你懂的| 国产精品久久福利| 一级成人国产| 欧美精品久久久久久久久久| 激情综合激情| 久久久久久久激情视频| 亚洲欧美国产三级| 国产精品女人久久久久久| 中国亚洲黄色| 亚洲国产视频一区| 欧美日韩ab| 日韩一级在线观看| 亚洲人成精品久久久久| 欧美高清在线播放| 一本色道久久99精品综合| 亚洲国产日韩一区二区| 老司机成人网| 亚洲精品女人| 99视频国产精品免费观看| 欧美成人a视频| 一本色道久久综合狠狠躁篇的优点| 亚洲欧洲一区二区三区| 欧美日韩精品一区二区| 亚洲一二区在线| 亚洲婷婷国产精品电影人久久| 欧美三区在线视频| 午夜精品偷拍| 久久精品一区二区国产| 亚洲国产另类精品专区| 亚洲国产天堂久久综合| 欧美日韩伊人| 欧美有码在线视频| 欧美与欧洲交xxxx免费观看 | 在线看无码的免费网站| 久久网站免费| 美女91精品| 一区二区三区欧美在线观看| 亚洲欧洲日本一区二区三区| 欧美三级电影精品| 久久久久久电影| 久久午夜视频| 亚洲免费婷婷| 欧美在线亚洲一区| 亚洲福利视频一区二区| 日韩一级裸体免费视频| 国产精品美女在线观看| 久久久水蜜桃| 毛片av中文字幕一区二区| 亚洲视频狠狠| 久久久久久噜噜噜久久久精品 | 一区二区三区欧美成人| aa级大片欧美| 国产精品日日摸夜夜添夜夜av| 久久精品在线播放| 欧美精品一区二区蜜臀亚洲 | 欧美涩涩视频| 午夜久久黄色| 老牛嫩草一区二区三区日本| 亚洲先锋成人| 免费观看欧美在线视频的网站| 亚洲网站在线看| 免费成人av| 久久精品国产一区二区三区| 蜜桃视频一区| 久久久综合网站| 欧美日韩国产不卡在线看| 久久免费精品视频| 国产精品私房写真福利视频| 欧美福利电影网| 国产伦精品一区二区三区照片91| 91久久精品网| 91久久久久久| 久久婷婷蜜乳一本欲蜜臀| 性久久久久久| 欧美视频一区在线| 亚洲精品欧美| 日韩一级在线观看| 欧美freesex8一10精品| 你懂的网址国产 欧美| 国产视频一区在线| 亚洲中无吗在线| 亚洲女优在线| 国产精品亚洲综合色区韩国| 99精品欧美一区二区三区 | 欧美精品在欧美一区二区少妇| 久久精品欧美日韩| 久久精品国产清自在天天线| 国产精品国产三级国产aⅴ9色| 亚洲精品欧美| 极品尤物av久久免费看| 欧美一区激情| 久久高清国产| 国产亚洲aⅴaaaaaa毛片| 欧美一区二区三区在线播放| 欧美亚洲视频| 国产精品一区二区女厕厕| 亚洲一区影音先锋| 欧美一乱一性一交一视频| 国产精品一区二区视频| 亚洲欧美日韩天堂一区二区| 欧美一区二区三区四区在线观看地址 | 国产一区二区丝袜高跟鞋图片 | 欧美gay视频| 在线看片第一页欧美| 久久综合狠狠综合久久综合88| 欧美成人午夜激情视频| 亚洲人成在线免费观看| 欧美日韩福利在线观看| 亚洲国产mv| 在线视频免费在线观看一区二区| 欧美日韩国产a| 中文欧美在线视频| 欧美一区深夜视频| 亚洲国内自拍| 欧美日韩国产成人在线91| 亚洲图片在线观看| 欧美在线免费播放| 亚洲高清二区| 国产精品成人va在线观看| 久久国产主播精品| 亚洲欧洲一区二区三区久久| 亚洲欧美日韩在线高清直播| 狠狠做深爱婷婷久久综合一区| 蜜桃av一区二区| 亚洲亚洲精品在线观看| 欧美不卡视频一区发布| 亚洲深夜福利在线| 国产一区二区三区奇米久涩 | 亚洲欧美激情一区| 免费在线欧美黄色| 一区二区三区av| 精品av久久久久电影| 欧美日产在线观看| 欧美一区观看| 中文网丁香综合网| 欧美激情麻豆| 亚洲在线国产日韩欧美| 亚洲成人在线| 国产精品视频你懂的| 欧美成人综合网站| 久久国产精彩视频| 在线一区视频| 欧美激情黄色片| 久久久国产精品一区二区中文 | 亚洲国产精品免费| 午夜精品福利视频| 日韩一级免费| 91久久国产综合久久91精品网站| 国产免费亚洲高清| 欧美精品成人| 老色鬼久久亚洲一区二区| 欧美一区免费| 亚洲欧美精品在线| 亚洲综合视频一区| 亚洲一区二区成人在线观看| 亚洲激情专区|