Go4Expert

Go4Expert (http://www.go4expert.com/)
-   MFC (http://www.go4expert.com/forums/mfc/)
-   -   CListBox (http://www.go4expert.com/forums/clistbox-t7073/)

codeguardian 27Oct2007 15:34

CListBox
 
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?

codeguardian 1Nov2007 13:25

Re: CListBox
 
I figured out the problem i defined the CListBox in the method and was destroyed at the end of the method.


All times are GMT +5.5. The time now is 11:24.