1 The difference between addstring and insertstring
Insertstring can specify an ordinal of the displayed arrangement,
All strings are sorted by ordinal, addstring just
The string is added to the drop-down list, as the position of the string
It is not known, and when you add a string, it affects the previous
The serial number.
insertstring use case: You need to specify a sequence number by default
String display, paired with SetCurSel, to display the string
2) whether to allow editing
The Type property is set to drop List does not allow editing
The Type property is set to dropdown allow editing
3) Display drop-down content
Showdropdown
4) Getlbtext and GetWindowText differences
The Getlbtext () function. The function is a combo box member function whose prototype is:
void Getlbtext (int nIndex, CString &rstring).
Parameter description: nindex is the index value of the data in the list box, rString is a string,
Function Description: Place the data with index number nindex in the rstring variable.
GetWindowText () This function obtains the text content that is displayed. Each control has a. Content that cannot be displayed is not available
Example:
ccombobox* combo= (ccombobox*) GetDlgItem (ID_COMBO1);
int nIndex = Combo->getcursel ();
Gets the currently selected project ID.
CString stritem;
Combo->getlbtext (NIndex, stritem); is to get the selected string.
MFC controls use tips: Combo Box