Copying an arry into a listbox
C / C++ / MFC
4
Posts
3
Posters
0
Views
1
Watching
-
hi, i want to know how to copy the contents of an array of strings into a listbox which can be displaied on screen? Any help would be nice. Thanks
-
-
yeah im a MFC user (only been using c++ for about 2 weeks) Thanks for the help that should do what i want it to do
let consider you array if of type char*
char
str
[][]={"code","project","is","great"};// now let
IDC_LIST1
is id of your list boxCListBox *
m_lst
=(CListBox*)GetDlgItem(IDC_LIST1
);//Check is we got valid pointer
if(m_lst)
{
///add the values in list boxfor(int i=0;i<4;i++)
{
//add string to list box
m_lst->AddString
(str[i]);
}
}
"I Think this Will Help" [Vote One Here,.....]
visit me at http://www.thisisalok.tk