今天做了很多工作啊,只学了一个控件,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
Initialization
Create |
Creates the combo box and attaches it to the CComboBox object. |
InitStorage |
Preallocates blocks of memory for items and strings in the list-box portion of the combo box. |
General Operations
GetCount |
Retrieves the number of items in the list box of a combo box. |
GetCurSel |
Retrieves the index of the currently selected item, if any, in the list box of a combo box. |
SetCurSel |
Selects a string in the list box of a combo box. |
GetEditSel |
Gets the starting and ending character positions of the current selection in the edit control of a combo box. |
SetEditSel |
Selects characters in the edit control of a combo box. |
SetItemData |
Sets the 32-bit value associated with the specified item in a combo box. |
SetItemDataPtr |
Sets the 32-bit value associated with the specified item in a combo box to the specified pointer (void*). |
GetItemData |
Retrieves the application-supplied 32-bit value associated with the specified combo-box item. |
GetItemDataPtr |
Retrieves the application-supplied 32-bit value associated with the specified combo-box item as a pointer (void*). |
GetTopIndex |
Returns the index of the first visible item in the list-box portion of the combo box. |
SetTopIndex |
Tells the list-box portion of the combo box to display the item with the specified index at the top. |
SetHorizontalExtent |
Sets the width in pixels that the list-box portion of the combo box can be scrolled horizontally. |
GetHorizontalExtent |
Returns the width in pixels that the list-box portion of the combo box can be scrolled horizontally. |
SetDroppedWidth |
Sets the minimum allowable width for the drop-down list-box portion of a combo box. |
GetDroppedWidth |
Retrieves the minimum allowable width for the drop-down list-box portion of a combo box. |
Clear |
Deletes (clears) the current selection (if any) in the edit control. |
Copy |
Copies the current selection (if any) onto the Clipboard in CF_TEXT format. |
Cut |
Deletes (cuts) the current selection, if any, in the edit control and copies the deleted text onto the Clipboard in CF_TEXT format. |
Paste |
Inserts 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. |
LimitText |
Limits the length of the text that the user can enter into the edit control of a combo box. |
SetItemHeight |
Sets the height of list items in a combo box or the height of the edit-control (or static-text) portion of a combo box. |
GetItemHeight |
Retrieves the height of list items in a combo box. |
GetLBText |
Gets a string from the list box of a combo box. |
GetLBTextLen |
Gets the length of a string in the list box of a combo box. |
ShowDropDown |
Shows or hides the list box of a combo box that has the CBS_DROPDOWN or CBS_DROPDOWNLIST style. |
GetDroppedControlRect |
Retrieves the screen coordinates of the visible (dropped-down) list box of a drop-down combo box. |
GetDroppedState |
Determines whether the list box of a drop-down combo box is visible (dropped down). |
SetExtendedUI |
Selects either the default user interface or the extended user interface for a combo box that has the CBS_DROPDOWN or CBS_DROPDOWNLIST style. |
GetExtendedUI |
Determines whether a combo box has the default user interface or the extended user interface. |
GetLocale |
Retrieves the locale identifier for a combo box. |
SetLocale |
Sets the locale identifier for a combo box. |
String Operations
AddString |
Adds 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. |
DeleteString |
Deletes a string from the list box of a combo box. |
InsertString |
Inserts a string into the list box of a combo box. |
ResetContent |
Removes all items from the list box and edit control of a combo box. |
Dir |
Adds a list of filenames to the list box of a combo box. |
FindString |
Finds the first string that contains the specified prefix in the list box of a combo box. |
FindStringExact |
Finds the first list-box string (in a combo box) that matches the specified string. |
SelectString |
Searches 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
DrawItem |
Called by the framework when a visual aspect of an owner-draw combo box changes. |
MeasureItem |
Called by the framework to determine combo box dimensions when an owner-draw combo box is created. |
CompareItem |
Called by the framework to determine the relative position of a new list item in a sorted owner-draw combo box. |
DeleteItem |
Called by the framework when a list item is deleted from an owner-draw combo box. |
CComboBox Overview | Base Class Members | Hierarchy Chart
分享到:
相关推荐
CFile类打开文件的有趣现象
商业编程-源码-CFile类打开文件的有趣现象.zip
本代码是《CFile类打开文件的有趣现象》一文的配套代码。 关键字:CFile,CFileDialog
包含CFile类的解释,详细介绍了CFile类的成员及其用法
用CFile类简单读写文件
CFILE类用法说明
CFile类编程 CFile类编程 CFile类编程 本文档仅是word文档,仅供初级学者参考
用CFile类的Write方法实现从键盘读取数据并写入进文件,并用Read方法实现从文件读出数据并显示到屏幕上
这个程序完成使用CFile类写日志,在VC6下可以通过编译并且使用正常。 主要使用了CFile类中的写函数和设置指针位置的函数。
解读VC++编程中的文件操作API和CFile类 通过此文件,可以更好地了解CFile类
讲的比较详细,视频讲述CFile类对文件的操作,大家可以看看
VS中关于文件类的操作指南,包括文件的打开写入等
利用CFile类实现文件的读操作,利用文件流fStream类实现文件的写操作。可实现文件的编辑保存和读取功能。
对CFile文件的使用,有点用哦。。。。。。。。。。。。。。。。。。。。。。。。。。
CFile类是MFC中的文件基类,它直接提供非缓冲的磁盘输入输出。
CFile解析properties文件.txt读取文件所用
供初用EVC读写文件的朋友参考,可能有用
一个简单的MFC保存文件的例子,适合初学者对MFC的学习
mfc文件操作类CFile ...除了用构造函数打开文件外还可以用CFile类的成员函数Open来打开 OPen函数原型 virtual BOOL Open( LPCTSTR lpszFilename,//打开文件的路径,可以是绝对路径,也可以是相对路径。 UINT nOpenF
解读VC++编程中的文件操作API和CFile类.doc