CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: List Box

  1. #1
    Join Date
    Jul 1999
    Posts
    24

    List Box

    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);


    }


  2. #2
    Join Date
    May 1999
    Location
    CA, USA
    Posts
    586

    Re: List Box

    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
    [email protected]
    http://home.earthlink.net/~railro/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured