|
-
August 13th, 2001, 11:01 AM
#1
combobox help
I have a combobox full of usernames. I wish to get the currently selected username (as a CString NOT the index of the string in the list because the contents of the list change at runtime and I will not know what names are in the list) so that I can perform actions on the CString. Currently I am having to use a
CStringArray to hold the same names as the combobox, grabbing the index of the current selection, and then getting the username at that index in the CStringArray. There must be an easier, more efficient way, but I am lost to it. GetDlgItemText(...) caught my eye in MSDN, but I don't know if it does what I want or how to use it. Could someone impart some wisdom?
Thanks
-
August 13th, 2001, 11:30 AM
#2
Re: combobox help
ComboBox has a class member you can use :
CComboBox::GetLBText
int GetLBText( int nIndex, LPTSTR lpszText ) const;
void GetLBText( int nIndex, CString& rString ) const;
-
August 13th, 2001, 11:33 AM
#3
Re: combobox help
Perfect! I appreciate the help with silly little things like this. Thank you.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|