Click to See Complete Forum and Search --> : List Box


Phil Thurmon
July 9th, 1999, 04:20 PM
I am calling a dialog box from MFC project. When I double click the listbox itam it will no appear in the Edit window. When I single
click on the edit box the selection will then display. When I do the box as a Dialog Box App. only it work fine. I would also like to
know of an easy way to add an entry in the edit window to the list box, If some one enters a number they can click on add button and
it will add the listing to the list box.

BOOL CPhone_Book::OnInitDialog()
{
CDialog::OnInitDialog();
m_number.AddString("(972)530-6666");
m_number.AddString("(214)777-5855");
m_number.AddString("(903)530-9146");
m_number.AddString("(555)897-9652");
m_number.AddString("(214)625-9874");
m_number.AddString("(903)369-9871");
m_number.AddString("(972)901-6652");
m_number.AddString("(972)530-9146");
m_number.SetCurSel(0);


return TRUE;
void CPhone_Book::OnDblclkListNum()
{
m_number.GetText(m_number.GetCurSel(), m_new_num);
UpdateData (FALSE);


}

Rail Jon Rogut
July 9th, 1999, 04:37 PM
Your code works properly... just check the tab order of your controls.

For an example which will help you, check out Example 6 at

http://home.earthlink.net/~railro/mfc_link.html.

Rail

Recording Engineer/Software Developer
Rail Jon Rogut Software
railro@earthlink.net
http://home.earthlink.net/~railro/