How can I get the value (string) of the current selection in a combobox?

railsmail picture railsmail · Jan 26, 2009 · Viewed 45.1k times · Source

How can I get the value (string) of the current selection in a combobox?

(Not the integer index)

Answer

Andy picture Andy · Jan 26, 2009

There might be a better way (my MFC is a bit rusty), but it seems like you should be able to call CComboBox::GetLBText(), passing it the current selection using CComboBox::GetCurSel().