adding items to list box
-
Hi, i have just started learning Vc++. can any one help me with my problem. i want to insert,delete an item to list box control how to do that?? and to insert folder name in list box? and also i want to access the each item(folder name). please can anyone help me....
maybe it is some helpful to you SetCurrentDirectory("c:\\"); m_List2.Dir(DDL_DIRECTORY|DDL_EXCLUSIVE, _T("*.*")); //example m_List2.DeleteString(0); m_List2.AddString("Welcome"); m_List2.InsertString(0,"Hi");
-
maybe it is some helpful to you SetCurrentDirectory("c:\\"); m_List2.Dir(DDL_DIRECTORY|DDL_EXCLUSIVE, _T("*.*")); //example m_List2.DeleteString(0); m_List2.AddString("Welcome"); m_List2.InsertString(0,"Hi");
Hi, i just added addstring code to project for add button but i am getting the below error. ////code///// void CUpdateDlg::OnAdd() { m_LIST.AddString("Welcome"); } ///////////// Error:- Compiling... UpdateDlg.cpp D:\Parichay\DesktopSearch\UpdateDlg.cpp(63) : error C2039: 'AddString' : is not a member of 'CString' c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(368) : see declaration of 'CString' Error executing cl.exe. DesktopSearch.exe - 1 error(s), 0 warning(s) Regards, Parichay B.P
-
Hi, i just added addstring code to project for add button but i am getting the below error. ////code///// void CUpdateDlg::OnAdd() { m_LIST.AddString("Welcome"); } ///////////// Error:- Compiling... UpdateDlg.cpp D:\Parichay\DesktopSearch\UpdateDlg.cpp(63) : error C2039: 'AddString' : is not a member of 'CString' c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(368) : see declaration of 'CString' Error executing cl.exe. DesktopSearch.exe - 1 error(s), 0 warning(s) Regards, Parichay B.P
-
i just created member variable for IDC_LIST (list box) using MFC class wizard. there i declared m_LIST of type CString. i have just started with vc+ i have no idea how these things works. can u plz help me in adding items to list box and deleting item from list box.
-
i just created member variable for IDC_LIST (list box) using MFC class wizard. there i declared m_LIST of type CString. i have just started with vc+ i have no idea how these things works. can u plz help me in adding items to list box and deleting item from list box.
-
The problem is i have created a list box with add , remove button & edit box. during the execution of the program i want the contents of the edit box to be added to list box when i click on add button. so tell me hw to start working with list box and declaring member variables for list box.. where and which function in my program i have use.
-
i just created member variable for IDC_LIST (list box) using MFC class wizard. there i declared m_LIST of type CString. i have just started with vc+ i have no idea how these things works. can u plz help me in adding items to list box and deleting item from list box.
read this carefully http://codeproject.com/combobox/listbox\_tut.asp
-
The problem is i have created a list box with add , remove button & edit box. during the execution of the program i want the contents of the edit box to be added to list box when i click on add button. so tell me hw to start working with list box and declaring member variables for list box.. where and which function in my program i have use.
-
Hi, i just added addstring code to project for add button but i am getting the below error. ////code///// void CUpdateDlg::OnAdd() { m_LIST.AddString("Welcome"); } ///////////// Error:- Compiling... UpdateDlg.cpp D:\Parichay\DesktopSearch\UpdateDlg.cpp(63) : error C2039: 'AddString' : is not a member of 'CString' c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(368) : see declaration of 'CString' Error executing cl.exe. DesktopSearch.exe - 1 error(s), 0 warning(s) Regards, Parichay B.P
parichaybp, AddString is function in CListBox not CString you should declare a variable ListBox: you eneter ListBox Control in your form and then right click in control(ListBox) and declare a variable for this control Now you can use this this function or functions You can use this code CString Str; Str="This is test"; m_List.AddString(Str); or other functions
-
parichaybp, AddString is function in CListBox not CString you should declare a variable ListBox: you eneter ListBox Control in your form and then right click in control(ListBox) and declare a variable for this control Now you can use this this function or functions You can use this code CString Str; Str="This is test"; m_List.AddString(Str); or other functions
-
parichaybp, AddString is function in CListBox not CString you should declare a variable ListBox: you eneter ListBox Control in your form and then right click in control(ListBox) and declare a variable for this control Now you can use this this function or functions You can use this code CString Str; Str="This is test"; m_List.AddString(Str); or other functions
Thanks its working. items are getting added.
-
parichaybp, AddString is function in CListBox not CString you should declare a variable ListBox: you eneter ListBox Control in your form and then right click in control(ListBox) and declare a variable for this control Now you can use this this function or functions You can use this code CString Str; Str="This is test"; m_List.AddString(Str); or other functions
one more thing how to remove the selected the item from list box using the remove button.
-
WhiteSky, i have one question for you : 1. do you read the other answers when replying to a post ? 2. (implisit one) Why do you repeat my answers ? X| :suss:
whats happen? 1-yes i see all answers, but sender reply to my answer well I should reply to question(parichaybp ) 2-you're good programer,and if my answer and your answer is equal because question is same (:rose: is good ) And have a nice day
-
the list is a list (CListCtrl), and the edit stays an edit (CEdit). what you have to do is : 1. read the edit 2. add to the list
CString strCaption;
m_Edit.GetWindowText(strCaption);
m_List.AddString(strCaption);do you understand it better now ?
can u plz tell how to remove the item using the remove button and reset the list
-
can u plz tell how to remove the item using the remove button and reset the list
-
i just created member variable for IDC_LIST (list box) using MFC class wizard. there i declared m_LIST of type CString. i have just started with vc+ i have no idea how these things works. can u plz help me in adding items to list box and deleting item from list box.
parichaybp wrote:
there i declared m_LIST of type CString.
Delete the variable and recreate it as a
CListBox
instead.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb