CComboBox的学习...

今天做了很多工作啊,只学了一个控件,CComboBox

CComboBox可以直接就绑定在控件里面,原来每个控件都可以Value或者Control两种性质的变量的。

然后,CComboBox控件,直接使用的时候,下拉的长度,要点点它的下箭头,然后拉到多长就多长,这个问题我弄了好半天才发现咯。

比较重要的

AddString 增加一个选择。

GetCount 取得一共有多少个选择在里面

GetCurSel 返回选中的选项的index值

GetLBText 根据index值取得该选择的内容。。。

ResetContent 清空CComboBox里面的东西

 

CComboBox Class Members

Construction/Destruction
Initialization
General Operations
String Operations
Overridables

Construction

CComboBoxConstructs a CComboBox object.

Initialization

CreateCreates the combo box and attaches it to the CComboBox object.
InitStoragePreallocates blocks of memory for items and strings in the list-box portion of the combo box.

General Operations

GetCountRetrieves the number of items in the list box of a combo box.
GetCurSelRetrieves the index of the currently selected item, if any, in the list box of a combo box.
SetCurSelSelects a string in the list box of a combo box.
GetEditSelGets the starting and ending character positions of the current selection in the edit control of a combo box.
SetEditSelSelects characters in the edit control of a combo box.
SetItemDataSets the 32-bit value associated with the specified item in a combo box.
SetItemDataPtrSets the 32-bit value associated with the specified item in a combo box to the specified pointer (void*).
GetItemDataRetrieves the application-supplied 32-bit value associated with the specified combo-box item.
GetItemDataPtrRetrieves the application-supplied 32-bit value associated with the specified combo-box item as a pointer (void*).
GetTopIndexReturns the index of the first visible item in the list-box portion of the combo box.
SetTopIndexTells the list-box portion of the combo box to display the item with the specified index at the top.
SetHorizontalExtentSets the width in pixels that the list-box portion of the combo box can be scrolled horizontally.
GetHorizontalExtentReturns the width in pixels that the list-box portion of the combo box can be scrolled horizontally.
SetDroppedWidthSets the minimum allowable width for the drop-down list-box portion of a combo box.
GetDroppedWidthRetrieves the minimum allowable width for the drop-down list-box portion of a combo box.
ClearDeletes (clears) the current selection (if any) in the edit control.
CopyCopies the current selection (if any) onto the Clipboard in CF_TEXT format.
CutDeletes (cuts) the current selection, if any, in the edit control and copies the deleted text onto the Clipboard in CF_TEXT format.
PasteInserts the data from the Clipboard into the edit control at the current cursor position. Data is inserted only if the Clipboard contains data in CF_TEXT format.
LimitTextLimits the length of the text that the user can enter into the edit control of a combo box.
SetItemHeightSets the height of list items in a combo box or the height of the edit-control (or static-text) portion of a combo box.
GetItemHeightRetrieves the height of list items in a combo box.
GetLBTextGets a string from the list box of a combo box.
GetLBTextLenGets the length of a string in the list box of a combo box.
ShowDropDownShows or hides the list box of a combo box that has the CBS_DROPDOWN or CBS_DROPDOWNLIST style.
GetDroppedControlRectRetrieves the screen coordinates of the visible (dropped-down) list box of a drop-down combo box.
GetDroppedStateDetermines whether the list box of a drop-down combo box is visible (dropped down).
SetExtendedUISelects either the default user interface or the extended user interface for a combo box that has the CBS_DROPDOWN or CBS_DROPDOWNLIST style.
GetExtendedUIDetermines whether a combo box has the default user interface or the extended user interface.
GetLocaleRetrieves the locale identifier for a combo box.
SetLocaleSets the locale identifier for a combo box.

String Operations

AddStringAdds a string to the end of the list in the list box of a combo box or at the sorted position for list boxes with the CBS_SORT style.
DeleteStringDeletes a string from the list box of a combo box.
InsertStringInserts a string into the list box of a combo box.
ResetContentRemoves all items from the list box and edit control of a combo box.
DirAdds a list of filenames to the list box of a combo box.
FindStringFinds the first string that contains the specified prefix in the list box of a combo box.
FindStringExactFinds the first list-box string (in a combo box) that matches the specified string.
SelectStringSearches for a string in the list box of a combo box and, if the string is found, selects the string in the list box and copies the string to the edit control.

Overridables

DrawItemCalled by the framework when a visual aspect of an owner-draw combo box changes.
MeasureItemCalled by the framework to determine combo box dimensions when an owner-draw combo box is created.
CompareItemCalled by the framework to determine the relative position of a new list item in a sorted owner-draw combo box.
DeleteItemCalled by the framework when a list item is deleted from an owner-draw combo box.

CComboBox OverviewBase Class MembersHierarchy Chart

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

jaketseng

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值