Add an
LBN_SELCHANGE[
^] handler to your dialog class that updates the edit control with the newly selected item:
CMyDialog::OnSelChange()
{
int nSel = m_ListBox.GetCurSel();
if (nSel != LB_ERR)
{
CString strText;
m_ListBox.GetText(nSel, strText);
m_EditBox.SetWindowText(strText);
}
}