1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

CListBox

Discussion in 'MFC' started by codeguardian, Oct 27, 2007.

  1. codeguardian

    codeguardian New Member

    Joined:
    Oct 26, 2007
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    0
    am trying to add a List Box to my application, but it never shows up. I use:

    CListBox listBox;
    RECT rc = {5,5,180,140};

    listBox.Create(WS_CHILD | WS_VISIBLE | LBS_STANDARD,rc,m_pMainWnd,ID_LB_ANIMLISTBOX);

    listBox.AddString("NUM 1");
    listBox.AddString("NUM 2");
    listBox.AddString("NUM 3");
    listBox.AddString("NUM 4");
    listBox.AddString("NUM 5");
    listBox.AddString("NUM 6");

    Am i missing something or doing something wrong?
     
  2. codeguardian

    codeguardian New Member

    Joined:
    Oct 26, 2007
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    0
    I figured out the problem i defined the CListBox in the method and was destroyed at the end of the method.
     

Share This Page